Given I'm running 15.10 my system should be using systemd
confirmed by...
$ ps -p1 | grep systemd && echo systemd || echo upstart
1 ? 00:00:02 systemd
systemd
But I have an upstart
script defined, ~/.config/upstart/startup.conf
description "my startup scripts"
start on desktop-start
task
console log
script
exec ~/scripts/startup.sh start
end script
The startup script works I guess using upstart
?
But then I have a shutdown script also defined, ~/.config/upstart/shutdown.conf
description "my shutdown scripts"
start on desktop-end
task
console log
script
exec ~/scripts/backup.sh start
end script
But that script does not start. And when I try to start either manually..
sudo start startup
or sudo start shutdown
I get..
start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
The shutdown script works if I run it manually from ~/scripts/backup.sh
.
Permissions
-rwxrwxr-x 1 deanresin deanresin 933 May 28 01:31 backup.sh
-rwxrwxr-x 1 deanresin deanresin 2061 May 28 14:06 startup.sh
-rw-rw-r-- 1 deanresin deanresin 124 May 28 14:04 shutdown.conf
-rw-rw-r-- 1 deanresin deanresin 218 May 28 14:02 startup.conf
thanks to commenter below it was a permission issue. Changed to..
-rwxrwxr-x 1 deanresin deanresin 124 May 28 14:04 shutdown.conf
-rwxrwxr-x 1 deanresin deanresin 218 May 28 14:02 startup.conf
Edit: for some reason startup.conf
doesn't require execution permissions. These permissions were working...
-rwxrwx--- 1 deanresin deanresin 124 May 28 14:04 shutdown.conf
-rw-rw---- 1 deanresin deanresin 218 May 28 14:02 startup.conf
Why is my startup script working and why isn't my shutdown script working? And why is upstart working? Or is it? I'm super confused.
~/.config/upstart/startup.conf
for the startup script but~/.config/shutdown.conf
(noupstart/
in the path) for shutdown. Is that a typo? – Andrea Lazzarotto May 28 '16 at 18:35.conf
files and of the two.sh
files. – Andrea Lazzarotto May 28 '16 at 18:40