Discussion:
[BackupPC-users] Gentoo init.d script
Stephen Zurcher
2004-01-18 19:01:02 UTC
Permalink
Hello,

I am currently setting up BackupPC for use on a Gentoo box and when
finally doing a trial run of the init script received the error:

* Starting BackupPC...
Wrong user: my userid is 0, instead of 1003 (backuppc)
BackupPC::Lib->new failed [ !! ]


I found only one reference to this in the archives (maybe I didn't use
good enough search parameters) and didn't see a solution.

After poking around in the start-stop-daemon man page I found an option
'--chuid' which will set the effective user (and group if you like, see
the man page) for the process.

Here is a copy of the init.d/backuppc script that actually works if
anyone is interested:

----- /etc/init.d/backuppc -------

# DESCRIPTION
#
# Startup init script for BackupPC on Gentoo` linux.
#
# Distributed with BackupPC version 2.0.2, released 6 Oct 2003.
#
# description: Starts and stops the BackupPC server
# Copy to /etc/init.d and run 'rc-update add backuppc default'
#
# Modified 18 Jan 2004 by Stephen Zurcher <***@hlcsoft.com>
# added --chuid option to start section to force effective user

# get our configuration options
source /etc/conf.d/backuppc

checkconfig() {
if [ ! -f ${CONF_FILE} ] ; then
eeror "No ${CONF_FILE} exists!"
fi
}

start() {
checkconfig || return 1
ebegin "Starting BackupPC"
start-stop-daemon --start --user ${USER} --pidfile ${PID_FILE}
--exec ${EXEC} --chuid ${USER} -- ${EXEC_OPTIONS}
eend $?
}

stop() {
ebegin "Stopping BackupPC"
start-stop-daemon --stop --pidfile ${PID_FILE} --name BackupPC
eend $?
}

restart() {
ebegin "Restarting BackupPC"
svc_stop
svc_start
eend $? "Failed to restart BackupPC"
}

status() {
return
eend $?
}

---- end of /etc/init.d/backuppc ----


Hope this helps someone else out there struggling to get things started.

Stephen Zurcher
HLCSoft, LLC
Ben
2004-01-18 19:39:00 UTC
Permalink
Hey thanks for that. I use Gentoo actually hehe, I didn't bother about
creating a startup script, all I did was put the following into
/etc/conf.d/local.start
su - backuppc -c /usr/local/BackupPC/bin/BackupPC -d &

Thanks though, I'll use yours instead.
Post by Stephen Zurcher
Hello,
I am currently setting up BackupPC for use on a Gentoo box and when
* Starting BackupPC...
Wrong user: my userid is 0, instead of 1003 (backuppc)
BackupPC::Lib->new failed [ !! ]
I found only one reference to this in the archives (maybe I didn't use
good enough search parameters) and didn't see a solution.
After poking around in the start-stop-daemon man page I found an option
'--chuid' which will set the effective user (and group if you like, see
the man page) for the process.
Here is a copy of the init.d/backuppc script that actually works if
----- /etc/init.d/backuppc -------
# DESCRIPTION
#
# Startup init script for BackupPC on Gentoo` linux.
#
# Distributed with BackupPC version 2.0.2, released 6 Oct 2003.
#
# description: Starts and stops the BackupPC server
# Copy to /etc/init.d and run 'rc-update add backuppc default'
#
# added --chuid option to start section to force effective user
# get our configuration options
source /etc/conf.d/backuppc
checkconfig() {
if [ ! -f ${CONF_FILE} ] ; then
eeror "No ${CONF_FILE} exists!"
fi
}
start() {
checkconfig || return 1
ebegin "Starting BackupPC"
start-stop-daemon --start --user ${USER} --pidfile ${PID_FILE}
--exec ${EXEC} --chuid ${USER} -- ${EXEC_OPTIONS}
eend $?
}
stop() {
ebegin "Stopping BackupPC"
start-stop-daemon --stop --pidfile ${PID_FILE} --name BackupPC
eend $?
}
restart() {
ebegin "Restarting BackupPC"
svc_stop
svc_start
eend $? "Failed to restart BackupPC"
}
status() {
return
eend $?
}
---- end of /etc/init.d/backuppc ----
Hope this helps someone else out there struggling to get things started.
Stephen Zurcher
HLCSoft, LLC
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
BackupPC-users mailing list
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/
c***@users.sourceforge.net
2004-01-18 22:43:01 UTC
Permalink
Post by Stephen Zurcher
I am currently setting up BackupPC for use on a Gentoo box and when
* Starting BackupPC...
Wrong user: my userid is 0, instead of 1003 (backuppc)
BackupPC::Lib->new failed [ !! ]
I found only one reference to this in the archives (maybe I didn't use
good enough search parameters) and didn't see a solution.
After poking around in the start-stop-daemon man page I found an option
'--chuid' which will set the effective user (and group if you like, see
the man page) for the process.
Here is a copy of the init.d/backuppc script that actually works if
Thanks. A few users have come across this problem. This fix will
be in the next version.

Craig

Loading...