Ubuntu 10.04

I have created this upstart script (/etc/init/pure-ftpd.conf):

# pure-ftpd - FTP server

description "Pure-FTPd server"

start on filesystem
stop on runlevel S

respawn
respawn limit 10 5
pid file /var/run/pure-ftpd.pid
console output

pre-start script
    test -x /usr/local/sbin/pure-ftpd || { stop; exit 0; }
end script

exec /usr/local/sbin/pure-ftpd --maxclientsnumber 2 --maxclientsperip 10 --prohibitdotfileswrite --prohibitdotfilesread --noanonymous --chrooteveryone --dontresolve --nochmod --pidfile /var/run/pure-ftpd.pid

But...

# start pure-ftpd
start: Unknown job: pure-ftpd

and

# service pure-ftpd start
start: Unknown job: pure-ftpd


What's the problem?
Is it necessary to do something more?
Is it necessary to create one script in /etc/init.d too?

link|improve this question

39% accept rate
feedback

2 Answers

up vote 2 down vote accepted

It usually means you have an error in the .conf file - for instance I'm not sure the pid stanza is supported in 10.04, stop can't be used in the script etc.

I'd try starting the file from scratch (with only start, stop etc), and then slowly building it up by adding more and more lines and testing it via start pure-ftpd.

For example:

# cat pure-ftpd.conf 
start on filesystem
stop on runlevel S

respawn
respawn limit 10 5

# start pure-ftpd
pure-ftpd start/running

# cat pure-ftpd.conf 
start on filesystem
stop on runlevel S

respawn
respawn limit 10 5
pid file /var/run/pure-ftpd.pid

# start pure-ftpd
start: Unknown job: pure-ftpd
link|improve this answer
The information in the wiki is very outdated (upstart.ubuntu.com/wiki). By other side, the upstart version in Lucid is 0.6.5-8 and the pid file should be supported: upstart.ubuntu.com/wiki/… – Simón Mar 17 '11 at 20:12
1  
AFAIK the pid stanza have been removed since the version 0.5.0 2008-08-12 "One of those deaf-mutes". Don't use it. – arrange Mar 17 '11 at 20:39
Someone knows where is the updated documentation? – Simón Mar 17 '11 at 22:50
thanks, it was the pid stanza. – Simón Mar 18 '11 at 0:22
feedback

The most relevant reference for job file syntax will be available when you run the command:

man 5 init

on your system. For Ubuntu 10.04, as you found in the previous answer, the pid file syntax is incorrect.

Any time you get that 'unknown job" error back, its a good idea to check the logs (pre 11.04, /var/log/daemon.log, 11.04 and greater everything goes in /var/log/syslog)

You may see an error like this:

init: /etc/init/test.conf:2: Unknown stanza
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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