View previous topic :: View next topic |
Author |
Message |
Tinitus Veteran
Joined: 20 Sep 2004 Posts: 1754
|
Posted: Wed Aug 17, 2011 9:44 am Post subject: [S]vboxwebsrv als bestimmter User starten |
|
|
Hallo,
ich habe mit Virtualbox als USER Test verschiedene VM's erstellt.
Wenn ich den Virtualbox Webserver per mitgeleifertem Script starte läuft dieser jedoch mit root Rechten. Er "sieht" also nicht die Konfiguration des Users Test.
Wie kann ich das ändern?
Hier noch die 2 Skripte zum Start des Webservers:
cat /etc/conf.d/vboxwebsrv
Code: |
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox-bin/files/vboxwebsrv-confd,v 1.2 2008/08/10 14:38:45 jokey Exp $
# The host to bind to (defaults to "localhost").
VBOXWEBSRV_HOST="localhost"
# Which port to on the host (defaults to 18083).
VBOXWEBSRV_PORT="18083"
# Session timeout, in seconds. (defaults to 20).
VBOXWEBSRV_TIMEOUT=20
# The interval in which the webservice checks for
# timed-out clients, in seconds. Normally does not
# need to be changed (defaults to 5).
VBOXWEBSRV_INTERVAL=5
|
cat /etc/init.d/vboxwebsrv
Code: | #!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox-bin/files/vboxwebsrv-initd,v 1.6 2010/01/28 13:11:46 patrick Exp $
depend() {
need net
}
start() {
#checkconfig || return $?
ebegin "Starting VirtualBox WebService"
start-stop-daemon --start --quiet --pidfile /var/run/vboxwebsrv.pid \
--background --make-pidfile --exec /opt/bin/vboxwebsrv \
-- -H ${VBOXWEBSRV_HOST} -p ${VBOXWEBSRV_PORT} -t ${VBOXWEBSRV_TIMEOUT} -i ${VBOXWEBSRV_INTERVAL}
eend $?
}
stop() {
ebegin "Stopping VirtualBox WebService"
start-stop-daemon --stop --quiet --pidfile /var/run/vboxwebsrv.pid
eend $?
}
|
G. Roland
Last edited by Tinitus on Thu Aug 18, 2011 5:54 am; edited 1 time in total |
|
Back to top |
|
|
Max Steel Advocate
Joined: 12 Feb 2007 Posts: 2229 Location: My own world! I and Gentoo!
|
Posted: Wed Aug 17, 2011 10:45 am Post subject: |
|
|
Im init-file kannst du noch ein
--user ${VBOXUSR} beim start-stop-daemon (wichtig: vor dem -- damit es dem start-stop-daemon und nicht dem vboxsvr übergeben wird) eintragen um diesen dann bequem in der conf.d zu definieren:
VBOXUSER="test" _________________ mfg
Steel
___________________
Heim-PC: AMD Ryzen 5950X, 64GB RAM, GTX 1080
Laptop: Intel Core i5-4300U, 16GB RAM, Intel Graphic
Arbeit-PC: Intel i5-1145G7, 16GB RAM, Intel Iris Xe Graphic (leider WSL2) |
|
Back to top |
|
|
Tinitus Veteran
Joined: 20 Sep 2004 Posts: 1754
|
Posted: Wed Aug 17, 2011 12:25 pm Post subject: |
|
|
Max Steel wrote: | Im init-file kannst du noch ein
--user ${VBOXUSR} beim start-stop-daemon (wichtig: vor dem -- damit es dem start-stop-daemon und nicht dem vboxsvr übergeben wird) eintragen um diesen dann bequem in der conf.d zu definieren:
VBOXUSER="test" |
Hallo,
habe es dann mal so eingetragen:
Code: |
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/virtualbox-bin/files/vboxwebsrv-initd,v 1.6 2010/01/28 13:11:46 patrick Exp $
depend() {
need net
}
start() {
#checkconfig || return $?
ebegin "Starting VirtualBox WebService"
start-stop-daemon --start --quiet --pidfile /var/run/vboxwebsrv.pid \
--background --make-pidfile --exec /opt/bin/vboxwebsrv \
-- -u ${VBOXUSR} -H ${VBOXWEBSRV_HOST} -p ${VBOXWEBSRV_PORT} -t ${VBOXWEBSRV_TIMEOUT} -i ${VBOXWEBSRV_INTERVAL}
eend $
}
stop() {
ebegin "Stopping VirtualBox WebService"
start-stop-daemon --stop --quiet --pidfile /var/run/vboxwebsrv.pid
eend $?
}
|
Dann startet der Daemon, aber dann Crasht der Server ...
Wo speichert VBOXServer ohne User Angabe seine config Dateien?
G. Roland |
|
Back to top |
|
|
Max Steel Advocate
Joined: 12 Feb 2007 Posts: 2229 Location: My own world! I and Gentoo!
|
Posted: Wed Aug 17, 2011 10:46 pm Post subject: |
|
|
Ich mein vor dem doppelstrich:
Code: | start-stop-daemon --start --quiet --pidfile /var/run/vboxwebsrv.pid \
--background --make-pidfile --exec /opt/bin/vboxwebsrv -u ${VBOXUSR} \
-- -H ${VBOXWEBSRV_HOST} -p ${VBOXWEBSRV_PORT} -t ${VBOXWEBSRV_TIMEOUT} -i ${VBOXWEBSRV_INTERVAL} |
Auf Jedenfall speichert der VBoxSVR ohne Angabe von einem User seine Configs bei root (eigentlich derjenige der den start-stop-daemon ausführt) _________________ mfg
Steel
___________________
Heim-PC: AMD Ryzen 5950X, 64GB RAM, GTX 1080
Laptop: Intel Core i5-4300U, 16GB RAM, Intel Graphic
Arbeit-PC: Intel i5-1145G7, 16GB RAM, Intel Iris Xe Graphic (leider WSL2) |
|
Back to top |
|
|
Tinitus Veteran
Joined: 20 Sep 2004 Posts: 1754
|
Posted: Thu Aug 18, 2011 5:53 am Post subject: |
|
|
Max Steel wrote: | Ich mein vor dem doppelstrich:
Code: | start-stop-daemon --start --quiet --pidfile /var/run/vboxwebsrv.pid \
--background --make-pidfile --exec /opt/bin/vboxwebsrv -u ${VBOXUSR} \
-- -H ${VBOXWEBSRV_HOST} -p ${VBOXWEBSRV_PORT} -t ${VBOXWEBSRV_TIMEOUT} -i ${VBOXWEBSRV_INTERVAL} |
Auf Jedenfall speichert der VBoxSVR ohne Angabe von einem User seine Configs bei root (eigentlich derjenige der den start-stop-daemon ausführt) |
Hallo,
Danke so klappt es.
G. Roland |
|
Back to top |
|
|
|