Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux-HA: Dev

Patch: pingd RA when executed as user

 

 

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded


ejhernandez at warp

Jun 24, 2008, 3:10 AM

Post #1 of 2 (161 views)
Permalink
Patch: pingd RA when executed as user

There is a line in pingd RA script where the pingd launch is done using
"su" command when there is defined a user. I suggest using "sudo" for
two main reasons:

1. Log every action it launches using syslog
2. Work with users which does not have a shell (/bin/false)

I've attached the patch. Maybe I'm wrong, correct me if so.

Best regards,
Attachments: pingd-sudo.patch (0.44 KB)


dejanmm at fastmail

Jun 24, 2008, 5:03 AM

Post #2 of 2 (143 views)
Permalink
Re: Patch: pingd RA when executed as user [In reply to]

Hi,

On Tue, Jun 24, 2008 at 12:10:17PM +0200, Enrique Jos? Hern?ndez Blasco wrote:
> There is a line in pingd RA script where the pingd launch is done using
> "su" command when there is defined a user. I suggest using "sudo" for
> two main reasons:
>
> 1. Log every action it launches using syslog
> 2. Work with users which does not have a shell (/bin/false)
>
> I've attached the patch. Maybe I'm wrong, correct me if so.

Many thanks for the patch.

Cheers,

Dejan

> Best regards,

> diff -r 0e53afc9c19f resources/OCF/pingd
> --- a/resources/OCF/pingd Tue Jun 17 12:46:19 2008 +0200
> +++ b/resources/OCF/pingd Tue Jun 24 12:09:52 2008 +0200
> @@ -152,7 +152,7 @@ pingd_start() {
> pingd_cmd="${HA_BIN}/pingd -D -p $OCF_RESKEY_pidfile -a $OCF_RESKEY_name -d $OCF_RESKEY_dampen $extras"
>
> if [ ! -z $OCF_RESKEY_user ]; then
> - echo "$pingd_cmd" | su - $OCF_RESKEY_user
> + sudo -u $OCF_RESKEY_user $pingd_cmd
> else
> $pingd_cmd
> fi

> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev[at]lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev[at]lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.