Skip to content

Linux Scripts to make any python coded script as a daemon process to run in the background as soon as the system starts and shuts down the process with the system shutdown.

Notifications You must be signed in to change notification settings

ujjwalsb/Daemon_Python_Script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

  1. After writing your "script.sh" file place it in the "/etc/init.d" directory

  2. Make sure that it has the full permission of 777

  3. Place your executable (python) script file in the exact location where you have mentioned in "script.sh" For my case- DIR=/usr/local/bin DAEMON=/$DIR/script.py

  4. To avoid any future problems please make sure that your executable python scripts can run on a terminal, also it has the full permission. For my case- $ python3 script.py

  5. After this followup in the command line or terminal from any location. $ sudo /etc/init.d/script.sh start $ sudo /etc/init.d/script.sh stop $ sudo /etc/init.d/script.sh restart

This should perform your desired task.

About

Linux Scripts to make any python coded script as a daemon process to run in the background as soon as the system starts and shuts down the process with the system shutdown.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published