public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Caspar Zhang <caspar@casparzhang.com>
To: Peng Haitao <penght@cn.fujitsu.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 3/4] at_allow01: Use lib to restart atd service
Date: Wed, 05 Dec 2012 12:40:02 +0800	[thread overview]
Message-ID: <50BED022.4000805@casparzhang.com> (raw)
In-Reply-To: <50BDBFC3.1010702@cn.fujitsu.com>

On 12/04/2012 05:17 PM, Peng Haitao wrote:
>
> On 12/04/2012 03:39 PM, Caspar Zhang wrote:
>> On 12/04/2012 03:21 PM, Peng Haitao wrote:
>>> + 84» .·cmdlib.sh
>>
>> Patch series looks good to me except this.
>>
>> sourcing a lib inside a function seems not so good. Yet I don't see any code style rules telling which is the correct place to put a shell lib source (commonly I think it would be the top in the file)
>>
> 	
> Yeah. I think so, too.
> If sourcing a lib in the top of the file, the case will fail.
> Because the case will use su xxx -lc to execute itself in xxx's home directory.
> But cmdlib.sh is in /opt/ltp/testcases/bin/, not in xxx's home directory.
>
>
> This has another method, add the following content in top of the file:
>
> if [ "$(id -ru)" = 0 ]; then
>          . cmdlib.sh
> fi
>
> I think add inside a function is simple:)
> If you think add in top of the file will better, I will resend it.
> Thanks.
>
I'm OK if the simpler way won't cause confusion :)

Caspar

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2012-12-05  5:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-04  7:21 [LTP] [PATCH 1/4] cmdlib.sh: Add four functions of controlling daemon Peng Haitao
2012-12-04  7:21 ` [LTP] [PATCH 2/4] runnetnstest.sh: fix a fail of vsftpd is disabled Peng Haitao
2012-12-07  7:50   ` Wanlong Gao
2012-12-04  7:21 ` [LTP] [PATCH 3/4] at_allow01: Use lib to restart atd service Peng Haitao
2012-12-04  7:39   ` Caspar Zhang
2012-12-04  9:17     ` Peng Haitao
2012-12-05  4:40       ` Caspar Zhang [this message]
2012-12-06 14:24     ` chrubis
2012-12-04  7:21 ` [LTP] [PATCH 4/4] at_deny01: " Peng Haitao
2012-12-07  7:50 ` [LTP] [PATCH 1/4] cmdlib.sh: Add four functions of controlling daemon Wanlong Gao

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=50BED022.4000805@casparzhang.com \
    --to=caspar@casparzhang.com \
    --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