Score:0

usbip service setup PID file

cn flag

I have this config in my /lib/systemd/system/usbip.service file, but I want the service to write a PID file to /var/run/usbipd.pid.

[Unit]
Description=usbip client
After=network.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/sh -c "/usr/lib/linux-tools/$(uname -r)/usbip attach -r 10.10.10.90 -b $(/usr/lib/linux-tools/$(uname -r)/usbip list -r 10.10.10.90 | grep '0403:6001' | cut -d: -f1)"
ExecStop=/bin/sh -c "/usr/lib/linux-tools/$(uname -r)/usbip detach --port=$(/usr/lib/linux-tools/$(uname -r)/usbip port | grep '<Port in Use>' | sed -E 's/^Port ([0-9][0-9]).*/\1/')"

[Install]
WantedBy=multi-user.target

I found an article with this information:

-P FILE, --pid FILE: Write process id to FILE.
If no FILE specified, use /var/run/usbipd.pid

I don't know where and how to put this in the usbip.service file.

Score:0
it flag

You're invoking sh in your Exec*= lines, but passing it a bunch of bashisms that sh does not understand

Your life would be simpler if your Exec*= statement just referred to bash scripst, and you did all your dancing around in the bash scripts. E.g ExecStart=/opt/local/startup.

Ojwhaaa Ojwhaaa avatar
cn flag
Thanks for replying, but I have no idea what your talking about. How does this apply to the config file, can you give an example?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.