init.d/sanlock | 5 +++-- src/main.c | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-)
New commits: commit 44b154b51be21e04fa7a8097fa7c2b2711ed21ad Author: Federico Simoncelli fsimonce@redhat.com Date: Tue Jan 10 17:02:06 2012 +0000
misc: run sanlock daemon as sanlock user
Signed-off-by: Federico Simoncelli fsimonce@redhat.com
diff --git a/init.d/sanlock b/init.d/sanlock index b2682ef..ceac659 100644 --- a/init.d/sanlock +++ b/init.d/sanlock @@ -25,7 +25,8 @@ prog="sanlock" lockfile="/var/run/$prog/$prog.pid" exec="/usr/sbin/$prog"
-SANLOCKOPTS="-U sanlock -G sanlock" +SANLOCKUSER="sanlock" +SANLOCKOPTS="-U $SANLOCKUSER -G $SANLOCKUSER"
[ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
@@ -38,7 +39,7 @@ start() { fi
echo -n $"Starting $prog: " - daemon $prog daemon $SANLOCKOPTS + daemon --user=$SANLOCKUSER $prog daemon $SANLOCKOPTS retval=$? echo [ $retval -eq 0 ] diff --git a/src/main.c b/src/main.c index 2ab0aae..f77bf3a 100644 --- a/src/main.c +++ b/src/main.c @@ -1066,8 +1066,11 @@ static int setup_listener(void) goto exit_fail;
rv = chown(addr.sun_path, com.uid, com.gid); - if (rv < 0) + if (rv < 0) { + log_error("could not set socket %s permissions: %s", + addr.sun_path, strerror(errno)); goto exit_fail; + }
rv = listen(fd, 5); if (rv < 0)
sanlock-devel@lists.fedorahosted.org