You are not logged in.

#1 2012-08-16 11:05:36

adr3nal1n
Member
Registered: 2010-09-23
Posts: 60

systemd vboxweb.service mod when needing to start as non-root user

Hi,

Don't know if this will help anyone, but here goes,

I wanted the systemd service unit to run using my local account but to get this to work, I had to do the following:

1. Create a file called vboxweb_mod.conf in /etc/tmpfiles.d with the below inside it (replace <user> <group> with your username and group you want vboxweb started with.)

D /run/vboxweb 0755 <user> <group>

2. Create /etc/systemd/system/vboxweb_mod.service to look like this: (replace <user> <group> with your username and group you want vboxweb started with.)

[Unit]
Description=VirtualBox Web Service
After=network.target

[Service]
Type=forking
PIDFile=/run/vboxweb/vboxweb.pid
ExecStart=/usr/bin/vboxwebsrv --pidfile /run/vboxweb/vboxweb.pid  --background
User=<user>
Group=<group>

[Install]
WantedBy=multi-user.target

3. Issue command

#systemctl enable vboxweb_mod.service

4. Either reboot or issue command

#systemctl start vboxweb_mod.service

Hope this helps someone out. (I had to do something similar to get sabnzbd running correctly as a systemd service. :-))

Offline

#2 2012-08-31 14:37:58

setone
Member
Registered: 2012-08-31
Posts: 9

Re: systemd vboxweb.service mod when needing to start as non-root user

Thanks, you helped me. I had gotten hung up on '--user = <vboxuser>' in the ExecStart line, which works for one of my other services, but not this one.

Offline

Board footer

Powered by FluxBB