I'm facing an issue with a python file that I'd like to start as a service.I named my service ocrserver and the script I want to start is in /home/administrator/ocr/ocrserver/init.py with some parameters added like --address --port etc...After reading the documentation from the FreeBSD siteI wrote the following script:#!/bin/sh# $FreeBSD$## PROVIDE: ocrserver # REQUIRE: NETWORK# KEYWORD: shutdown# add the following line to /etc/rc.conf to enable the ocrserver:# ocrserver_enable=YES. /etc/rc.subrname=ocrserverrcvar=ocrserver_enable# default values: ${ocrserver_enable=NO}base_path=/home/administrator/ocr/ocrserveraddress=localhosthttp_port=8080pyproxy_port=10800log_level=debugpidfile=${base_path}/ocrserver.pidcommand=/usr/sbin/daemon# -p : daemon handler pidfile# -f : redirect stdout and stderr to /dev/null# -c : change working dir to rootcommand_args=-p ${pidfile} -f -c /home/administrator/ocr/ocrserver/__init__.py \--address ${address} --http-port ${http_port} --log-level ${log_level} \--pyproxy-port ${pyproxy_port}procname=/home/administrator/ocr/ocrserver/__init__.pycommand_interpreter=/usr/local/bin/python3.3load_rc_config $namerun_rc_command $1Then I added one line setting up the corresponding rcvar to YES in the /etc/rc.conf file. and I launched it:sudo service ocrserver startwhere I get the message Starting ocrserver.and after entering a sudo service ocrserver status, I can see that the service is not running.I also ran a pgrep -l python3.3 command to see if any python3 process was running but no resultI precise that I did a chmod 755 on the file to make it readable and executable by all the users.Has anyone some experience with this kind of thing?Thanks for your answers.
FreeBSD: How to start a python script as daemon?
freebsd;python;rc