Bug#894510: debhelper: Because it is listing tmpfiles in systemd's only, conf overriding is not working
Seyeong Kim
seyeong.kim at canonical.com
Wed May 16 11:03:52 BST 2018
Hello
I noticed that tmpfiles are built based on systemd source directory not local machine /
e.g debian/systemd/usr/lib/tmpfiles.d/x11.conf
so 00rsyslog.conf file ( from rsyslog pkg, in /usr/lib/tmpfiles.d/ ) is not there
I checked this with dh_installinit —no-start
I understand override feature(actually i misunderstood it )
no way to do this based on installed tmpfiles?( or not recommended ? )
## dh_installinit
if (!$dh{NOSCRIPTS}) {
# Include postinst-init-tmpfiles if the package ships any files
# in /usr/lib/tmpfiles.d or /etc/tmpfiles.d
my @tmpfiles;
find({
wanted => sub {
my $name = $File::Find::name;
return unless -f $name;
print "Seyeong1 : ".$name."\n";
$name =~ s/^\Q$tmp\E//g;
print "Seyeong2 : ".$name."\n";
if ($name =~ m,^/usr/lib/tmpfiles\.d/, ||
$name =~ m,^/etc/tmpfiles\.d/,) {
print "Seyeong3 : ".$name."\n";
push @tmpfiles, $name;
}
},
no_chdir => 1,
}, $tmp);
if (@tmpfiles > 0) {
autoscript($package,"postinst", "postinst-init-tmpfiles",
"s,#TMPFILES#," . join(" ", sort @tmpfiles).",g");
}
}
generated postinst.debhelper
echo part is what i added
# Automatically added by dh_installinit
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
# In case this system is running systemd, we need to ensure that all
# necessary tmpfiles (if any) are created before starting.
if [ -d /run/systemd/system ] ; then
echo /usr/lib/tmpfiles.d/debian.conf /usr/lib/tmpfiles.d/home.conf /usr/lib/tmpfiles.d/journal-nocow.conf /usr/lib/tmpfiles.d/legacy.conf /usr/lib/tmpfiles.d/systemd-nologin.conf /usr/lib/tmpfiles.d/systemd.conf /usr/lib/tmpfiles.d/tmp.conf /usr/lib/tmpfiles.d/var.conf /usr/lib/tmpfiles.d/x11.conf
systemd-tmpfiles --create /usr/lib/tmpfiles.d/debian.conf /usr/lib/tmpfiles.d/home.conf /usr/lib/tmpfiles.d/journal-nocow.conf /usr/lib/tmpfiles.d/legacy.conf /usr/lib/tmpfiles.d/systemd-nologin.conf /usr/lib/tmpfiles.d/systemd.conf /usr/lib/tmpfiles.d/tmp.conf /usr/lib/tmpfiles.d/var.conf /usr/lib/tmpfiles.d/x11.conf >/dev/null || true
fi
fi
# End automatically added section
# Automatically added by dh_installdeb
dpkg-maintscript-helper rm_conffile /etc/bash_completion.d/systemctl-bash-completion.sh 204-1~ -- "$@"
# End automatically added section
# Automatically added by dh_installdeb
dpkg-maintscript-helper rm_conffile /etc/bash_completion.d/systemd-bash-completion.sh 204-1~ -- "$@"
# End automatically added section
# Automatically added by dh_installdeb
dpkg-maintscript-helper mv_conffile /etc/systemd/systemd-logind.conf /etc/systemd/logind.conf 204-1~ -- "$@"
# End automatically added section
# Automatically added by dh_installdeb
dpkg-maintscript-helper mv_conffile /etc/systemd/systemd-journald.conf /etc/systemd/journald.conf 204-1~ -- "$@"
# End automatically added section
# Automatically added by dh_installdeb
dpkg-maintscript-helper rm_conffile /etc/dbus-1/system.d/org.freedesktop.machine1.conf 228-5~ -- "$@"
# End automatically added section
# Automatically added by dh_installdeb
dpkg-maintscript-helper rm_conffile /etc/X11/xinit/xinitrc.d/50-systemd-user.sh 228-3~ -- "$@"
# End automatically added section
On 12 May 2018, 2:41 AM +0900, Niels Thykier <niels at thykier.net>, wrote:
> Seyeong Kim:
> > Hello
> >
> > I tested them but symptom is still there
> >
> > so I put “print “#TMPFILES#” on autoscripts/postinst-init-tmpfiles like below
> >
> > ###################
> > if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
> > # In case this system is running systemd, we need to ensure that all
> > # necessary tmpfiles (if any) are created before starting.
> > if [ -d /run/systemd/system ] ; then
> > print "#TMPFILES#"
> > systemd-tmpfiles --create #TMPFILES# >/dev/null || true
> > fi
> > fi
> > ###################
> >
> > and built systemd with this deb helper
> >
> > When installing systemd after build, i got below string ( installed 00rsyslog.conf in /usr/lib/tmpfiles.d/ and copied to /etc/tmpfiles.d/ )
> >
> > ###
> > Error: no such file "debian.conf home.conf journal-nocow.conf legacy.conf systemd-nologin.conf systemd.conf tmp.conf var.conf x11.conf"
> >
> > ###
> >
>
> Can you show me the full postinst generated with your patched version?
> AFAICT, neither dh_installinit nor dh_installsystem should pass those
> file names as a single argument. When I tested locally, the shell
> snippet seemed to correctly pass each file as separate arguments.
>
> > I wanted to see TMPFILES list and there is no 00rsyslog.conf so.. 00rsyslog.conf can't override var.conf
> >
>
> The override support that the patch adds is that
> /etc/tmpfiles.d/foo.conf can now override /usr/lib/tmpfiles.d/foo.conf
> (previously, it could not).
>
> There was nothing to support "foo.conf" overriding "bar.conf" (or
> "00rsyslog.conf" overriding "var.conf").
>
> > maybe this need to be analyzed more?
> >
> > Thanks
> >
> >
> > [...]
>
> For your concrete issue, you will have to use one of Michael's
> recommendations listed in:
>
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=894510#37, OR
>
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=894510#42
>
> Sorry, but that is the best I can offer you without diverting for the
> recommendations from the systemd maintainers.
>
> ~Niels
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20180516/4d672310/attachment-0001.html>
More information about the Pkg-systemd-maintainers
mailing list