I recently installed the Google App Engine Development server on my FreeBSD home server to be able to test my GAE app remotely. What I can't figure out is how to run the Python development server as a background process on boot.

I am running everything in a jail. So, currently, when I want to start the dev server I have to log in to the server, open up the jail and run the Python script manually. Worst thing is that I have to stay connected, because when my laptop loses connection to the jail, the Python process is stopped. I can't figure out a way to run it as a background process / daemon.

In my search of finding a solution (like rc.d, which I don't get at all), I already made a .sh script that runs the command, but I didn't find a way to run that at stratup.

This is the complete command: python dev_appserver.py --host= --port=2222 /mnt/path/to/gae_app/

  • the screen command can run any command in a background that can be connected-to later
    – Skaperen
    Oct 3, 2015 at 10:42

3 Answers 3


Here what i do in Linux Hop it's help

Step1: Create a Service sudo vi /lib/systemd/system/NameofYourService.service

Step 2:Add This line and edit the locations in Text

Description=Example python App running on Ubuntu

ExecStart=/usr/bin/python3 /home/app/app.py
# Restart service after 10 seconds if the dotnet service crashes:


Step3: Enable and start the service

sudo systemctl enable NameofYourService.service
sudo systemctl start NameofYourService.service

for Disable

sudo systemctl stop NameofYourService.service
sudo systemctl disable NameofYourService.service

for logs

sudo journalctl -fu NameofYourService.service

Note:If you use a library in python know that services is running under the root and you need to intstall the library in root


for running your script as a daemon, refer here

for making it on onboot in freebsd refer their official documentation on rcorder()(8)

  • I tried that. I now have a script created in /usr/local/etc/rc.d/ named gae. I have added gae_enabled="YES" to /etc/rc.conf. Still not starting anything at boot. Oct 3, 2015 at 12:28
  • @RebelDesigner is it getting listed in the services/daemons that are configured to start at boot?,ls /etc/rc*.d
    – Corleone
    Oct 3, 2015 at 12:40
  • Yes it is. Is there anything else I need to do? Oct 3, 2015 at 14:17

you can use cron job

Step 1 – Your Python Script path


Step 2 - Open cron using this commands

 sudo crontab -e

choose your editor mostly nano scroll do at the end

Step 3 - add this line

@reboot python /home/app/app.py

Step 4 - Ctrl+x to exit if you are using nano text editor

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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