Systemd on vivid beta

Colin Law clanlaw at gmail.com
Mon Mar 9 19:56:02 UTC 2015


On 9 March 2015 at 18:08, Tom H <tomh0665 at gmail.com> wrote:
> 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.

More research led me to do that just a few minutes before receiving
this, but it does not seem to have helped. Is the generated unit human
readable?

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

OK.  I am slightly put off by the fact that I got round to learning a
bit about upstart and converting one of my scripts just before it was
announced that ubuntu was changing to systemd :(

Thanks

Colin




More information about the ubuntu-users mailing list