0
我在安裝Google Cloudprint Python腳本時遇到了麻煩。無法運行Google Cloudprint作爲守護程序
[email protected]:~/tmp$ sudo service cloudprint start
Starting Google Cloud Print: daemon module required for -d
yum install python-daemon, or apt-get install python-daemon, or pip install python-daemon
[email protected]:~/tmp$ sudo apt-get install python-daemon
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-daemon is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
即使我已經安裝了python守護進程我給了我一個錯誤。
我的init-d腳本是這樣的:
#!/bin/bash
# /etc/rc.d/cloudprint
# Description: Starts the Google Cloud Print script on startup
# ----------------
#
### BEGIN INIT INFO
# Provides: Cloud-Print
# Required-Start: $cups $network $local_fs $syslog
# Required-Stop: $local_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Start Google Cloud Print
### END INIT INFO
USER="holmen"
PIDFILE="/var/run/cloudprint/pid"
case $1 in
start)
echo -n "Starting Google Cloud Print: "
sudo -u $USER cloudprint -d -p $PIDFILE
;;
stop)
echo -n "Stopping Google Cloud Print: "
killall cloudprint
;;
restart)
echo -n "Restarting Google Cloud Print: "
killall cloudprint
sudo -u $USER cloudprint -d -p $PIDFILE
;;
*)
echo "Usage: cloudprint {start|stop|restart}"
;;
esac