Chinaunix首页 | 论坛 | 博客
  • 博客访问: 341622
  • 博文数量: 93
  • 博客积分: 4578
  • 博客等级: 上校
  • 技术积分: 1005
  • 用 户 组: 普通用户
  • 注册时间: 2010-10-13 08:12
文章分类
文章存档

2012年(2)

2011年(45)

2010年(46)

分类: LINUX

2011-11-16 08:41:24



  1. [root@thinkpad]# cat /etc/init.d/ smfpd
  2. #!/bin/sh

  3. # smfpd is a parallel port handling daemon. It needs root privileges
  4. # to use iopl(2), inb(2) and outb(2) system calls.
  5. #
  6. # smfpd uses inet domain socket, this script should be run
  7. # after network initialization.
  8. #
  9. # This script is a part of Unified Linux Driver package.
  10. # If your MFP device is not connected to LPT port, you can safely
  11. # disable execution of this script - uncomment 'exit 0' at the next line.
  12. # exit 0

  13. SMFPD=/usr/sbin/smfpd
  14. test -x $SMFPD || exit 5

  15. PATH=/usr/sbin:/sbin:/usr/bin:/bin
  16. SMFPD=smfpd

  17. PROCESS_PID=`ps ax | grep "[0-9]:[0-9][0-9] $SMFPD" | awk '{print $1}'`

  18. case "$1" in
  19. check)
  20. if test -z "$PROCESS_PID"; then
  21. echo "Process is not running"
  22. else
  23. echo "Process $SMFPD[$PROCESS_PID] is running"
  24. fi
  25. ;;
  26. start)
  27. if test -z "$PROCESS_PID"; then
  28. echo -n "Starting smfpd daemon ... "
  29. $SMFPD
  30. echo "done"
  31. $0 check
  32. else
  33. echo "Process $SMFPD[$PROCESS_PID] is already running"
  34. fi
  35. ;;
  36. stop)
  37. if test -n "$PROCESS_PID"; then
  38. echo -n "Stopping smfpd daemon ... "
  39. kill -TERM $PROCESS_PID
  40. echo "done"
  41. else
  42. echo "Process is not running"
  43. fi
  44. ;;
  45. restart)
  46. $0 stop
  47. sleep 1
  48. $0 start
  49. ;;
  50. *)
  51. echo "Usage: $0 {check|start|stop|restart}"
  52. exit 1
  53. ;;
  54. esac

  55. exit 0


  56. [root@thinkpad ]# ls -al /etc/rc1.d/*smfpd
  57. lrwxrwxrwx. 1 root root 15 5月 19 09:41 /etc/rc1.d/K07smfpd -> ../init.d/smfpd
  58. [root@thinkpad init.d]# rm /etc/rc*.d/*smfpd
  59. rm:是否删除符号链接 "/etc/rc0.d/K07smfpd"?n
  60. rm:是否删除符号链接 "/etc/rc1.d/K07smfpd"?n
  61. rm:是否删除符号链接 "/etc/rc2.d/S93smfpd"?n
  62. rm:是否删除符号链接 "/etc/rc3.d/S93smfpd"?n
  63. rm:是否删除符号链接 "/etc/rc4.d/S93smfpd"?n
  64. rm:是否删除符号链接 "/etc/rc5.d/S93smfpd"?n
  65. rm:是否删除符号链接 "/etc/rc6.d/K07smfpd"?n
  66. [root@thinkpad init.d]#


  67. [root@thinkpad init.d]# ls -al /etc/rc1.d/*smfpd
  68. lrwxrwxrwx. 1 root root 15 5月 19 09:41 /etc/rc1.d/K07smfpd -> ../init.d/smfpd
  69. [root@thinkpad init.d]# rm /etc/rc*.d/*smfpd
  70. rm:是否删除符号链接 "/etc/rc0.d/K07smfpd"?n
  71. rm:是否删除符号链接 "/etc/rc1.d/K07smfpd"?n
  72. rm:是否删除符号链接 "/etc/rc2.d/S93smfpd"?n
  73. rm:是否删除符号链接 "/etc/rc3.d/S93smfpd"?n
  74. rm:是否删除符号链接 "/etc/rc4.d/S93smfpd"?n
  75. rm:是否删除符号链接 "/etc/rc5.d/S93smfpd"?n
  76. rm:是否删除符号链接 "/etc/rc6.d/K07smfpd"?n
  77. [root@thinkpad init.d]#




阅读(2454) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~