vhclient -t EXIT does not seem to work

9 posts / 0 new
Last post
roman.saveljev
vhclient -t EXIT does not seem to work

Hello,

I am trying to call "vhclient -t EXIT" to finalize a running client daemon instance, but the process does not really shut down:

docker@boot2docker:~$ vhclient --help
VirtualHere Client 2.9.9, Use USB devices over a network
Usage: vhclient [-h] [-c <str>] [-a] [-t <str>] [-r <str>] [-l <str>] [-m] [-n]
-h, --help Display this help
-c, --config=<str> configuration file to use
-a, --admin administrator mode
-t, --control=<str> Issue command to running client
-r, --redirect=<str> When used t/d/x/i/u redirect output to file instead of console
-l, --log=<str> log file to write ("OSEventLog"=syslog)
-m
-n, --daemon run as a daemon
docker@boot2docker:~$ sudo vhclient -c /etc/virtualhere/config.ini -n -l /var/log/vhclient.log
docker@boot2docker:~$ ps aux | grep vhclient
root 731 0.0 0.0 2440 432 ? S 18:53 0:00 /bin/sh /etc/rc.d/vhclient-use-all
root 21533 4.3 0.5 9140 5780 ? Ssl 19:18 0:00 vhclient -c /etc/virtualhere/config.ini -n -l /var/log/vhclient.log
docker 22223 0.0 0.0 2444 436 pts/0 S+ 19:18 0:00 grep vhclient
docker@boot2docker:~$ vhclient -t EXIT

docker@boot2docker:~$ ps aux | grep vhclient
root 731 0.0 0.0 2440 432 ? S 18:53 0:00 /bin/sh /etc/rc.d/vhclient-use-all
root 21533 7.8 0.5 9140 5780 ? Ssl 19:18 0:00 vhclient -c /etc/virtualhere/config.ini -n -l /var/log/vhclient.log
docker 22226 0.0 0.0 2444 452 pts/0 S+ 19:18 0:00 grep vhclient
docker@boot2docker:~$ ps aux | grep vhclient
root 731 0.0 0.0 2440 432 ? S 18:53 0:00 /bin/sh /etc/rc.d/vhclient-use-all
root 21533 9.1 0.5 9140 5780 ? Ssl 19:18 0:01 vhclient -c /etc/virtualhere/config.ini -n -l /var/log/vhclient.log
docker 22229 0.0 0.0 2444 444 pts/0 S+ 19:18 0:00 grep vhclient
docker@boot2docker:~$ ps aux | grep vhclient
root 731 0.0 0.0 2440 432 ? S 18:53 0:00 /bin/sh /etc/rc.d/vhclient-use-all
root 21533 9.8 0.5 9140 5780 ? Ssl 19:18 0:06 vhclient -c /etc/virtualhere/config.ini -n -l /var/log/vhclient.log
docker 22236 0.0 0.0 2444 428 pts/0 S+ 19:19 0:00 grep vhclient
docker@boot2docker:~$

The /var/log/vhclient.log looks like this (I did not clean after sending kill -9 to vhclient last time):

18:53:25 INFO :Log Started
18:53:25 INFO :VirtualHere Client 2.9.9 starting (Compiled: Jun 28 2015 10:10:37)
18:53:25 INFO :Using config at /etc/virtualhere/config.ini
18:53:25 INFO :IPC available at /tmp/vhclient
18:53:25 INFO :VirtualHere client is running as a service
18:53:25 INFO :connect select localhost:7575, error 111 (Connection refused)
19:00:35 INFO :Server ping timeout, shutting down connection 1...
19:00:35 INFO :recv msg size failed, error 9 (Bad file descriptor)
19:08:58 INFO :Received IPC verb="LIST", arg=""
19:10:03 INFO :Server ping timeout, shutting down connection 1...
19:10:03 INFO :recv msg size failed, error 9 (Bad file descriptor)
19:11:24 INFO :Received IPC verb="LIST", arg=""
19:11:33 INFO :Received IPC verb="HELP", arg=""
19:12:53 INFO :Server ping timeout, shutting down connection 1...
19:12:53 INFO :recv msg size failed, error 9 (Bad file descriptor)
19:13:47 INFO :Received IPC verb="EXIT", arg=""
19:18:13 INFO :Log Started
19:18:13 INFO :VirtualHere Client 2.9.9 starting (Compiled: Jun 28 2015 10:10:37)
19:18:13 INFO :Using config at /etc/virtualhere/config.ini
19:18:13 INFO :IPC available at /tmp/vhclient
19:18:13 INFO :VirtualHere client is running as a service
19:18:20 INFO :Received IPC verb="EXIT", arg=""

Actually, I can not close the client even with a mild kill. Only kill -9 will work

Regards,
Roman

Michael
what os are you using for the

what os are you using for the client? x86 ubuntu 14:04?

roman.saveljev
It is based on Tiny Core

It is based on Tiny Core Linux distribution: https://github.com/boot2docker/boot2docker

Michael
How are you installing usbip

How are you installing usbip kernel modules on the tinycore under docker?

roman.saveljev
Hi,

Hi,

I am compiling a custom boot2docker.iso, where I offer customized .config for Linux kernel build. Here it is: http://filebin.ca/27ne1u9J00S9

And here is the patch:

$ git show 61e0ae335878ee600121ada61ab38066706942fe
commit 61e0ae335878ee600121ada61ab38066706942fe
Author: Roman Saveljev <roman.saveljev@haltian.com>
Date: Wed Jul 1 12:57:25 2015 +0300

Enable USB IP drivers for TCE kernel build

diff --git a/kernel_config b/kernel_config
index 667652d..e2c3d80 100644
--- a/kernel_config
+++ b/kernel_config
@@ -3275,7 +3275,10 @@ CONFIG_USB_STORAGE_ENE_UB6250=y
#
# CONFIG_USB_MDC800 is not set
# CONFIG_USB_MICROTEK is not set
-# CONFIG_USBIP_CORE is not set
+CONFIG_USBIP_CORE=m
+CONFIG_USBIP_VHCI_HCD=m
+CONFIG_USBIP_HOST=m
+# CONFIG_USBIP_DEBUG is not set
# CONFIG_USB_MUSB_HDRC is not set
# CONFIG_USB_DWC3 is not set
# CONFIG_USB_DWC2 is not set

I update it through menuconfig

Thanks,
Roman

Michael
Yes i think this is because

Yes i think this is because you are using the device at the same time as shutting down the client, will check my code on this ....

roman.saveljev
Ahha, thanks for the hint! I

Ahha, thanks for the hint! I am indeed having auto-use on (as you have guessed in another topic) and even enforcing it whenever the flag drops. I manually configure hub access and deactivate discovery.

Now I try this kind of sequence:

vhclient -t "MANUAL HUB REMOVE ALL"
vhclient -t EXIT

And the client actually finishes. I think it is a better "workaround" than having it killed with SIGKILL.

Thanks,
Roman

Michael
OK, 3.0.2 of the client will

OK, 3.0.2 of the client will shutdown correctly even if a device is currently in use or auto-use is on.

roman.saveljev
Thanks Michael! I appreciate

Thanks Michael! I appreciate very much your fast support and issue resolution.
I want to bet big on VirtualHere to deliver - it will be an excellent leverage in infrastructure improvement.

Meanwhile, I will continue the evaluation. There is one other issue that sometimes ACPI can not reboot/shutdown the machine with the running client (even after graceful client exit). I have to study it more and will come back with more details and on a separate topic.

Regards,
Roman

Log in or register to post comments