From: Wanlong Gao <gaowanlong@cn.fujitsu.com>
To: Garrett Cooper <yanegomi@gmail.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH v2] cron02: fix a bug of /etc/init.d/crond is nonexistent
Date: Fri, 30 Mar 2012 09:13:19 +0800 [thread overview]
Message-ID: <4F7508AF.6070408@cn.fujitsu.com> (raw)
In-Reply-To: <CAGH67wQ9xgA2f_t=524My2uzyeRnuMWTyZfDQQU_zkMhuca8Vg@mail.gmail.com>
On 03/30/2012 09:07 AM, Garrett Cooper wrote:
> On Thu, Mar 29, 2012 at 6:05 PM, Peng Haitao <penght@cn.fujitsu.com> wrote:
>> /etc/init.d/crond is nonexistent in fedora16, so should use systemctl.
>>
>> Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
>> ---
>> testcases/commands/cron/cron02 | 14 ++++++++++++++
>> 1 file changed, 14 insertions(+)
>>
>> diff --git a/testcases/commands/cron/cron02 b/testcases/commands/cron/cron02
>> index 0c05c95..d348936 100755
>> --- a/testcases/commands/cron/cron02
>> +++ b/testcases/commands/cron/cron02
>> @@ -52,12 +52,26 @@ do_setup(){
>> }
>> fi
>>
>> + # running under systemd?
>> + if command -v systemctl >/dev/null 2>&1; then
>> + HAVE_SYSTEMCTL=true
>> + else
>> + HAVE_SYSTEMCTL=false
>> + fi
>> +
>> # restart cron daemon
>> # Red Hat uses crond, SuSE/Other uses cron.
>> if [ -x /etc/init.d/crond ]; then
>> /etc/init.d/crond restart
>> elif [ -x /etc/init.d/cron ]; then
>> /etc/init.d/cron restart
>> + elif $HAVE_SYSTEMCTL; then
>> + for crond in "crond" "cron"; do
>> + if systemctl is-enabled $crond.service >/dev/null 2>&1; then
>> + systemctl restart $crond.service
>> + break
>> + fi
>> + done
>> else
>> echo "Could not determine cron init.d script."
>> exit 1
>
> Reviewed-by: Garrett Cooper <yanegomi@gmail.com>
pushed, thanks Peng, Garrett,
Wanlong Gao
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
>
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
prev parent reply other threads:[~2012-03-30 1:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-29 9:58 [LTP] [PATCH] cron02: fix a bug of /etc/init.d/crond is nonexistent Peng Haitao
2012-03-29 10:06 ` Garrett Cooper
2012-03-30 1:05 ` [LTP] [PATCH v2] " Peng Haitao
2012-03-30 1:07 ` Garrett Cooper
2012-03-30 1:13 ` Wanlong Gao [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=4F7508AF.6070408@cn.fujitsu.com \
--to=gaowanlong@cn.fujitsu.com \
--cc=ltp-list@lists.sourceforge.net \
--cc=yanegomi@gmail.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