linux(SUSE) service 自启动服务

1.what is rc_status

The commands from rc.status are actually SuSe specific I think. AFAICT they handle two things: output to the user and the final return status of the script. rc_status checks if the previous command (i.e. the start/restart/stop of a service)executed successfully and sets the "status value", which is the return value returned by rc_exit (which you place at the end of your init.d script). Source

You can conceivably write your shell script without them, but I assume they help making sure that your script conforms to LSB requirements and blends in well with other system scripts. I bet most of this is actually documented in the /etc/rc.status file, though. I just don't have a suse box handy.

2.what is checkproc

http://www.linuxcertif.com/man/8/checkproc/

NAME

Checkproc - Checks for a process by full path name
Pidofproc - Checks for a process by exec base name

SYNOPSIS

checkproc  [ -v ] [ -L ] [ -k ] [ -N ] [ -p   pid_file ] [ -i   ingnore_file ] [ -c   root ] [ -z /full/path/to/executable

checkproc [-v] [-k] [-nname_of_kernel_thread

pidofproc [-kbasename_of_executable

REQUIRED

/full/path/to/executable or  name_of_kernel_thread
Specifies the executable which processes should be found, or alternatively, if the option Or alternated, if option  -n is used, the name of the  kernel thread. This argument is always required.

EXAMPLE

checkproc /usr/sbin/sendmail returns all pids of running sendmail processes. checkproc -p /var/myrun/lpd.pid /usr/sbin/lpd returns the command line or the basename of the process pid found in  /var/run/lpd.pid.

EXIT CODES

The exit codes without the option  -k  have the following  LSB  conform conditions:
0
Program is running
1
No process but pid file found
3
No process and no pid file found
101
Wrong syntax on command line
102
Other errors

If the option -k is used checkproc uses exit codes like startproc(8) or killproc(8) do:

0
Program is running
1
Generic or unspecified error
2
Invalid or excess argument(s)
4
Insufficient privilege(s)
5
Program is not installed
7
Program is not running

in some cases a message is send to standard error or, if no standard error available, syslogd(8) is used.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值