0

I need to develop a program with Python3 which executs automaticly programs at specific times. I must use a deamon.

That's why I created a file into /usr/bin/ and /etc/init.d/.

However, when I run this command : /etc/init.d/gobatch (where gobatch is my program name) I got this error :

/etc/init.d/gobatch: 13: /etc/init.d/gobatch: that: not found

And I don't understand it.

/etc/init.d/gobatch file:

#### BEGIN INIT INFO 
# Provides:          chillispot et freeradius dans le chroot 
# Required-Start:    $local_fs $network 
# Required-Stop:     $local_fs $remote_fs _
# Default-Start:     2 3 4 5 
# Default-Stop:      0 1 6 
# Short-Description: Wireless & LAN Access Point Controller 
# Description:       ChilliSpot is an open source captive portal 
#                    or wireless LAN access point controller. 
### END INIT INFO 


DESC=Deamon that allows you to run cyclicaly at a date or a specific time a program
DEAMON=/home/nicolas/gobatch

I followed this tutorial: https://openclassrooms.com/courses/faire-un-demon-sous-linux

Thank's for help!

UPDATE

Into my Python installation script I do that:

# Give the rights
os.chmod('/etc/init.d/gobatch', 0o755)
os.system('chown root:root /etc/init.d/gobatch')

And I start it with: /etc/init.d/gobatch start into my terminal but I get the same error.

2 Answers 2

2

Your program must be executable and be owned by root user/group.

sudo chmod 755 /etc/init.d/gobatch
sudo chown root:root /etc/init.d/gobatch

To start your daemon, do the following:

sudo /etc/init.d/gobatch start
0
1

I solved the problem.

I forgot " on the deamon description.

DESC="Deamon that allows you to run cyclicaly at a date or a specific time a program"
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .