Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[S]vboxwebsrv als bestimmter User starten
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
Tinitus
Veteran
Veteran


Joined: 20 Sep 2004
Posts: 1754

PostPosted: Wed Aug 17, 2011 9:44 am    Post subject: [S]vboxwebsrv als bestimmter User starten Reply with quote

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
View user's profile Send private message
Max Steel
Advocate
Advocate


Joined: 12 Feb 2007
Posts: 2041
Location: My own world! I and Gentoo!

PostPosted: Wed Aug 17, 2011 10:45 am    Post subject: Reply with quote

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
___________________
Sorry for my bad English.

Heim-PC: Intel i7-5820K, 32GB RAM, GTX 1080
Laptop: Intel Core i5-4300U, 16GB RAM, Intel Graphic
Arbeit-PC: Intel i5-3470S, 16GB RAM, Intel Graphic
Back to top
View user's profile Send private message
Tinitus
Veteran
Veteran


Joined: 20 Sep 2004
Posts: 1754

PostPosted: Wed Aug 17, 2011 12:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
Max Steel
Advocate
Advocate


Joined: 12 Feb 2007
Posts: 2041
Location: My own world! I and Gentoo!

PostPosted: Wed Aug 17, 2011 10:46 pm    Post subject: Reply with quote

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
___________________
Sorry for my bad English.

Heim-PC: Intel i7-5820K, 32GB RAM, GTX 1080
Laptop: Intel Core i5-4300U, 16GB RAM, Intel Graphic
Arbeit-PC: Intel i5-3470S, 16GB RAM, Intel Graphic
Back to top
View user's profile Send private message
Tinitus
Veteran
Veteran


Joined: 20 Sep 2004
Posts: 1754

PostPosted: Thu Aug 18, 2011 5:53 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum