[HEADS-UP] systemd for F14 - the next steps
abo at root.snowtree.se
Thu Jul 15 21:32:45 UTC 2010
ons 2010-07-14 klockan 20:54 +0200 skrev Lennart Poettering:
> On Wed, 14.07.10 13:31, Chris Adams (cmadams at hiwaay.net) wrote:
> > Once upon a time, Lennart Poettering <mzerqung at 0pointer.de> said:
> > > ExecStartPre=-/bin/mkdir -p /var/run/foo ; -/sbin/restorecon /var/run/foo
> > Why would you ignore the exit code? If you can't make the directory and
> > set the context, you shouldn't start the service.
> Well, dunno, maybe if SELinux is disabled via selinux=0 restorcon fails?
Nah, please don't hide errors like that. It just makes things harder to
It could be done properly in a shell command but ExecStartPre probably
doesn't take a shell command, just arguments for exec(), so you'd have
to do "ExecStartPre=bash -c 'blahblah....'". Anyway, we're trying to
avoid starting a shell for every daemon.
The solution is to rewrite it in C code and have a "RunDir=/var/run/foo"
option in the unit file which creates the directory and calls restorecon
if necessary. For complicated cases where a shell command really is
needed you can use the bash -c trick or put the command in a shell
script file and just specify
> The default is of course to check all return values, i.e. you have to
> explicitly prefix the commands with "-" to ignore them.
Is this feature really necessary? I think it would be best to avoid
More information about the devel