From: Peng H. <pe...@cn...> - 2013-07-03 02:07:43
|
On 07/01/2013 10:12 PM, ch...@su... wrote: > Hi! ... >> +if [ -n "$SYSLOG_NAME" ]; then >> + if [ $HAVE_SYSTEMCTL == 1 ]; then >> + status_daemon $SYSLOG_NAME >> + if [ $? -ne 0 ]; then >> + restart_daemon $SYSLOG_NAME >> + FLAG=1 >> + fi ... >> +if [ $FLAG -eq 1 ]; then >> + if [ $HAVE_SYSTEMCTL == 1 ]; then >> + stop_daemon $SYSLOG_NAME >> + else >> + $SYSLOG_NAME stop >/dev/null 2>&1 >> + fi >> +fi >> + > > We have similar code to restart cron in cron/cron02 and to restart nscd > in sssd/sssd-libs.sh. > > What about we create a short library with a common code to restart > system daemons? So that any new testcase would just need to source the A short library is in cmdlib.sh. stop_daemon, status_daemon and restart_daemon is used in the patch. The syslog daemon may be syslog, rsyslog, syslog-ng etc, so I make the patch which is similar to syslog-lib.sh. Thanks. -- Best Regards, Peng > lib and call: > > daemon_restart "cron" > > or: > > daemon_stop "syslog" > |