[arch-general] In the systemd scheme, where should startup/stop scripts for things systemd can't handle go?

Tom Gundersen teg at jklm.no
Fri Jul 27 17:01:37 EDT 2012


On Fri, Jul 27, 2012 at 10:52 PM, David Benfell
<benfell at parts-unknown.org> wrote:
> So now that I've got a network through systemd, I ran into trouble
> with some daemon service files that I crafted by hand.
>
> None of the following directives will work (culled from different files):
>
> ExecStartPre=cd /etc/solr
> ExecStart=$JAVA_HOME/bin/java -jar $JAVA_OPTS start.jar $JETTY_OPTS >>
> /var/log/jetty.log 2>&1
> ExecStop=kill `pidof -o %PPID /usr/sbin/dictd` 2>/dev/null 1>/dev/null
>
> Basically lots of things that would be normal in a shell are
> problematic.

Yup, Exec* does not accept shell syntax, but does accept some variable
substitution (see systemd.service(5) for details).

> So I need to create separate scripts to start and stop
> some daemons. I'm thinking I definitely do not want to use /etc/rc.d
> for this (I had to back out and go back to init and /etc/rc.d is still
> in use for that).
>
> Is there some consensus on where such scripts should go?

Not really, as far as I know. However, it seems that it is common to
put "helper scripts" that are shipped with systemd in
/usr/lib/systemd/ and those shipped with udev in /usr/lib/udev/, so
for user-created helper scripts, I think I'd put them in
/etc/systemd/.

-t


More information about the arch-general mailing list