Upstart-initiated job is not launching as I expect, hangs instead

Scott James Remnant scott at netsplit.com
Fri Jan 7 12:02:40 UTC 2011


Upstart is likely following the "logger" process because you're
executing that first.

On Thu, Jan 6, 2011 at 11:10 PM, J.B. Nicholson-Owens <jbn at illinois.edu> wrote:
> I'm new to Upstart and I've written the following Upstart job:
>
> ================================
> #
> # Start the radmind server as the "radmind" user, creating the
> # user if necessary.
> #
> description "radmind server"
> author "J.B. Nicholson-Owens <jbn at illinois.edu>"
> version "1.0"
>
> start on network-up
> stop on network-down
>
> expect fork
>
> pre-start script
>        # If the user "radmind" does not exist, create a "radmind" user.
>        # We don't care what UID this user gets.
>        radmind_user_exists=`grep '^radmind:' /etc/passwd | wc -l`
>        logger -t radmind "${radmind_user_exists} radmind users exist on this
> machine."
>
>        if [ ${radmind_user_exists} -eq 0 ]; then
>                su --command "useradd --comment 'radmind server user'
> --user-group --create-home"
>                logger -t radmind "created radmind user"
>                su --command "usermod --expiredate 1 --lock radmind"
>                logger -t radmind "modified radmind user"
>        fi
> end script
>
> script
>        # launch the server process.
>        logger -t radmind "launching radmind process"
>        su --command /usr/sbin/radmind radmind
> end script
> ==============================
>
> I thought the job would begin the instant I saved it (globally-readable,
> root-writable) as /etc/init/radmind.conf but that didn't happen (as far as I
> know).
>
> When I tried to start the job with initctl:
>
> $ sudo initctl start radmind
> [sudo] password for administrator:
> initctl: Job is already running: radmind
> $ sudo initctl stop radmind
>
> Here initctl never returns.
>
> I'm doing something wrong, obviously, but it's not clear to me what I'm
> doing wrong.
>
> Any help would be appreciated.
>
> Thanks.
> --
> J.B. Nicholson-Owens, Website and Network Administrator
>
> --
> upstart-devel mailing list
> upstart-devel at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/upstart-devel
>



More information about the upstart-devel mailing list