rc.tsmc 664 B

123456789101112131415161718192021222324252627
  1. #!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
  2. ##
  3. ## rc.tsmc -- Run-Commands for TSMC
  4. ##
  5. %config
  6. tsmc_enable="yes"
  7. %common
  8. tsmc_pidfile="@l_prefix@/var/tsmc/dsmc.sched.pid"
  9. %start -p 200 -u root
  10. opServiceEnabled tsmc || exit 0
  11. ( PATH=/bin:/sbin:/usr/bin:/usr/sbin:$PATH
  12. nohup @l_prefix@/bin/dsmc sched </dev/null >/dev/null 2>&1 &
  13. echo "$!" >$tsmc_pidfile
  14. ) </dev/null >/dev/null 2>&1
  15. %stop -p 200 -u root
  16. opServiceEnabled tsmc || exit 0
  17. if [ -f $tsmc_pidfile ]; then
  18. kill -TERM `cat $tsmc_pidfile` >/dev/null 2>&1 || true
  19. sleep 2
  20. kill -KILL `cat $tsmc_pidfile` >/dev/null 2>&1 || true
  21. fi