Systemd on vivid beta

Tom H tomh0665 at gmail.com
Mon Mar 9 18:08:31 UTC 2015


On Mon, Mar 9, 2015 at 9:34 AM, Colin Law <clanlaw at gmail.com> wrote:
>
> That is what I hoped. The problem is with shutdown, but only on power
> down. I can run systemctl stop myservice.service and it functions
> correctly, and I can start it again. But if I shutdown it does not
> seem to be getting the timing right. My init.d script starts
>
> #! /bin/sh
> ### BEGIN INIT INFO
> # Provides:          automount
> # Required-Start:    $remote_fs $syslog
> # Required-Stop:     $remote_fs $syslog
> # Default-Start:     2 3 4 5
> # Default-Stop:      0 1 6
> # Short-Description: Automounts SAMBA shares
> # Description:       Dynamically (un)mounts specific SAMBA shares.
> ### END INIT INFO
>
> Which I thought should mean that it will complete the stop before
> shutting down syslog, but I have littered logging through the script
> and I see a variable number of these displayed in syslog before
> syslogd quits. Sometimes I do not even see the first one, which is
> the first executable line in the script. I inherited the script years
> ago and don't know much about init scripting but the above looks ok,
> and it works fine in upstart.
>
> Am I doing something obviously silly? Alternatively any suggestions
> to analyse the problem further?

I'd start by adding "$network" to your "Required-Start" and
"Required-Stop" lines. It might create a better dependency translation
when a systemd .service unit is generated from the sysvinit script.

Longer-term, you should look into migrating your mounts to systemd .mount units.

More later, sorry.




More information about the ubuntu-users mailing list