python - Linux Script to start webiopi service -
log_file=/var/log/webiopi config_file=/etc/webiopi/config path=/sbin:/usr/sbin:/bin:/usr/bin desc="webiopi" name=webiopi home=/usr/share/webiopi/htdocs daemon=/usr/bin/python daemon_args="-m webiopi -l $log_file -c $config_file" pidfile=/var/run/$name.pid scriptname=/etc/init.d/$name # exit if package not installed [ -x "$daemon" ] || exit 0
1)the -x "$daemon" check if python has been installed didn't check package webiopi, doesn't it?
2)does python -m run whole package, not individual module?
# read configuration variable file if present [ -r /etc/default/$name ] && . /etc/default/$name
3)how configuration file /etc/webiopi/config values go /etc/default/webiopi?from above, didn't see command that.
# # function starts daemon/service # do_start() { # return # 0 if daemon has been started # 1 if daemon running # 2 if daemon not started start-stop-daemon --start --quiet --chdir $home --pidfile $pidfile --exec $daemon --test > /dev/null \ || return 1
4) above start python process not webiopi? what's point of python test?it didn't specify return 0?
start-stop-daemon --start --quiet --chdir $home --pidfile $pidfile --exec $daemon --background --make-pidfile -- \ $daemon_args \ || return 2
5) above start webiopi starting python -m webiopi * in background?
Comments
Post a Comment