From: chrubis@suse.cz
To: Peng Haitao <penght@cn.fujitsu.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] cron_tests.sh: fix a bug of syslog daemon is disabled
Date: Wed, 3 Jul 2013 13:18:23 +0200 [thread overview]
Message-ID: <20130703111823.GC2906@rei> (raw)
In-Reply-To: <51D386E8.8090603@cn.fujitsu.com>
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.
Then I do not understand why the patch adds systemctl detection
code to the cron_tests.sh. It is allready present in the cmdlib.sh
> The syslog daemon may be syslog, rsyslog, syslog-ng etc,
> so I make the patch which is similar to syslog-lib.sh.
Which is why I object to the patch, it copies code from library to the
testcase, which is wrong in terms of longterm maintenance.
Ideal solution would be to move the syslog detection to the cmdlib.sh
and make a canonical name for syslog so that if you request to restart
the daemon in test with:
daemon_restart syslog
Everything is detected automatically, the syslog binary, systemd vs
system V init, etc. And everythig is kept in one file, no code
duplications.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
prev parent reply other threads:[~2013-07-03 11:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-28 3:10 [LTP] [PATCH] cron_tests.sh: fix a bug of syslog daemon is disabled Peng Haitao
2013-07-01 9:25 ` Wanlong Gao
2013-07-01 14:12 ` chrubis
[not found] ` <51D386E8.8090603@cn.fujitsu.com>
2013-07-03 11:18 ` chrubis [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130703111823.GC2906@rei \
--to=chrubis@suse.cz \
--cc=ltp-list@lists.sourceforge.net \
--cc=penght@cn.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox