Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've enabled Upstart User Jobs and configured a few jobs. These jobs can be started/stopped by the respective user and all is well. However the start on stanza doesn't seem to have effect:

start on runlevel [2345]

Everytime the system is rebooted, I'd have to ssh into the machine and start [job name]. How can I force the system to also start those user jobs?

share|improve this question
    
have you tried run level 6? It is specifically for reboot. –  Nasir Dec 15 '13 at 1:56
add comment

2 Answers

The start on stanza seems not to work in all variations as I already explained here: Safely close virtualbox machine on host reboot

Use this here:

start on started rc RUNLEVEL=[2345]
share|improve this answer
    
Thanks for the reply, but it doesn't seem to work for me. After a reboot, the process isn't started. –  bouke Jun 20 '13 at 13:03
add comment

Following is an upstart script that worked for me to allow user jobs to start at system startup. Without it I could not get them to work either.

author 'Bradley Ayers'
description 'Enables user job "start on" stanzas to be honored at boot'

task
start on starting rc-sysinit

script
cat /etc/passwd | while read line
do
    user=`echo $line | cut -d: -f1`
    home=`echo $line | cut -d: -f6`
    if [ -d "$home/.init" ]
        then
        sudo -u $user initctl status rc-sysinit
    fi
done
end script

Source: I got the script from: Enabling Upstart user jobs to start at boot

share|improve this answer
    
But this would only be a workaround and not a real solution... –  the_Seppi Mar 8 at 17:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.