I am running CentOS7 on a Rasberry Pi2B with a licensed version of VirtualHere and everything works as expected.
When i invoke:
[root@rpi2 ~]# /usr/sbin/vhusbdarmpi2 -b -c /root/config.ini
the program starts as a daemon and runs. But when I try to enable automatic start via systemd the service starts but then exits after a short time.
Here is the systemd service file. I used the one from this forum:
[root@rpi2 ~]# cat /etc/systemd/system/virtualhere.service
[Unit]
Description=VirtualHere USB Sharing
After=network.target
[Service]
Type=idle
ExecStartPre=/bin/sh -c 'logger VirtualHere settling...;sleep 1s;logger VirtualHere settled'
ExecStart=/usr/sbin/vhusbdarmpi2 -b -c /root/config.ini
ExecStop=/bin/kill -WINCH ${MAINPID}
[Install]
WantedBy=multi-user.target
And this is being logged:
[root@rpi2 ~]# cat /var/log/messages
Apr 18 20:57:01 rpi2 systemd: Started VirtualHere USB Sharing.
Apr 18 20:57:01 rpi2 systemd: Starting VirtualHere USB Sharing...
Apr 18 20:57:01 rpi2 logger: VirtualHere settling...
Apr 18 20:57:02 rpi2 logger: VirtualHere settled
Apr 18 20:57:02 rpi2 vhusbdarmpi2[1681]: >>> Starting VirtualHere USB Server v2.8.3 (Built: Apr 13 2016, 20:32:58)<<<
Apr 18 20:57:02 rpi2 vhusbdarmpi2[1681]: Using configuration /root/config.ini
Apr 18 20:57:02 rpi2 kill: kill: cannot find process ""
Apr 18 20:57:02 rpi2 systemd: virtualhere.service: control process exited, code=exited status=1
Apr 18 20:57:02 rpi2 vhusbdarmpi2[1682]: Server licensed to= max_devices=3
Apr 18 20:57:02 rpi2 vhusbdarmpi2[1682]: Using large URB's
Apr 18 20:57:02 rpi2 vhusbdarmpi2[1682]: Listening on all network interfaces at port 7575
Apr 18 20:57:02 rpi2 vhusbdarmpi2[1682]: Found High speed device [0424:ec00] "0x0424, 0xec00" at address 111
Apr 18 20:57:02 rpi2 vhusbdarmpi2[1682]: Found High speed device [125f:312a] "ADATA, ADATA USB Flash Drive" at address 115
Apr 18 20:57:02 rpi2 vhusbdarmpi2[1682]: Found Low speed device [05ac:0221] "Apple, Inc, Apple Keyboard" at address 1122
Apr 18 20:57:02 rpi2 vhusbdarmpi2[1682]: Call to syncSetConfig 1 Failed with err 16 (Resource busy)
Apr 18 20:57:02 rpi2 kernel: usb 1-1.2.2: usbfs: interface 0 claimed by usbhid while 'vhusbdarmpi2' sets config #1
Apr 18 20:58:29 rpi2 systemd: Starting Cleanup of Temporary Directories...
Apr 18 20:58:29 rpi2 systemd: Started Cleanup of Temporary Directories.
Apr 18 20:58:32 rpi2 systemd: virtualhere.service stop-sigterm timed out. Killing.
Apr 18 20:58:32 rpi2 systemd: Unit virtualhere.service entered failed state.
Apr 18 20:58:32 rpi2 systemd: virtualhere.service failed.
This always happens and it is quite annoying since I want to run this as a service with autostart.
Help would be really appreciated here :/ I am still getting used to systemd and something is still a bit of mystery for me.
Thanks a lot.
VectorX
You cannot run the server as
You cannot run the server as a daemon, so remove the
-b
argument and it should work ok then.