pcscd.rc 737 B

12345678910111213141516171819202122232425262728293031323334
  1. # /etc/rc.d/pcscd: start/stop pcscd
  2. #
  3. SSD=/sbin/start-stop-daemon
  4. PROG=/usr/sbin/pcscd
  5. PID=/run/pcscd/pcscd.pid
  6. case $1 in
  7. start)
  8. $SSD --start --pidfile $PID --exec $PROG
  9. ;;
  10. stop)
  11. $SSD --stop --retry 10 --pidfile $PID
  12. ;;
  13. restart)
  14. $0 stop
  15. $0 start
  16. ;;
  17. status)
  18. $SSD --status --pidfile $PID
  19. case $? in
  20. 0) echo "$PROG is running with pid $(cat $PID)" ;;
  21. 1) echo "$PROG is not running but the pid file $PID exists" ;;
  22. 3) echo "$PROG is not running" ;;
  23. 4) echo "Unable to determine the program status" ;;
  24. esac
  25. ;;
  26. *)
  27. echo "Usage: $0 [start|stop|restart|status]"
  28. ;;
  29. esac
  30. # End of file