Stephen Zurcher
2004-01-18 19:01:02 UTC
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
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