Last active
February 20, 2018 07:40
-
-
Save thinkAmi/3726e0cc9bd009419b65 to your computer and use it in GitHub Desktop.
Raspberry Pi 2 + systemd + udevで、USBデバイス挿入時にサービスを起動する
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SUBSYSTEM=="usb", ACTION=="add", ATTRS{idProduct}=="01bb", ATTRS{idVendor}=="054c", RUN+="/bin/sh -c 'echo Hello at `date` > /home/pi/hello.log'" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SUBSYSTEM=="usb", ACTION=="add", ATTRS{idProduct}=="01bb", ATTRS{idVendor}=="054c", GROUP="usb", TAG+="systemd", ENV{SYSTEMD_WANTS}+="rc-s320.service", NAME="pasori320" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Pasori RC-S320 service | |
Requires=dev-pasori320.device | |
After=dev-pasori320.device | |
[Service] | |
Type=simple | |
ExecStart=/bin/sh -c "echo Hello by `date` >> /home/pi/hello2.log" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment