내가 소유한 서비스(systemd에서 호출)에 대한 스크립트 start.sh
인 스크립트가 있습니다 .ExecStart
DISPLAY=:0 xbindkeys
스크립트에 해당 줄을 추가하면 start.sh
시작되지 않습니다 xbindkeys
.
user@host:~$ service SERVICE status
● SERVICE.service - "MY AWESOME SERVICE"
Loaded: loaded (/etc/systemd/system/SERVICE.service; enabled)
Active: active (running) since Thu 2020-03-05 21:44:22 CET; 13min ago
Main PID: 5508 (bash)
CGroup: /system.slice/SERVICE.service
├─5508 /bin/bash /home/user/start.sh
└─5530 /usr/lib/PROGRAM
Mar 05 21:44:24 HOSTNAME bash[5508]: <SOME LOGS>
Hint: Some lines were ellipsized, use -l to show in full.
user@host:~$ ps -ef | grep xbindkeys
user 6181 3545 0 21:57 pts/1 00:00:00 grep xbindkeys
user@host:~$
또한 별도의 서비스를 만들고 원래 서비스를 이에 종속되게 만들려고 했습니다.
[Unit]
Description="Xbindkeys Service to block keys"
Before=SERVICE.service
Requires=SERVICE.service
[Service]
Environment="DISPLAY=:0"
ExecStart=/usr/bin/xbindkeys
Restart=always
[Install]
WantedBy=multi-user.target
시작할 수가 없어요
user@host:~$ service xbindkeys status
● xbindkeys.service - "Xbindkeys Service to block keys"
Loaded: loaded (/etc/systemd/system/xbindkeys.service; disabled)
Active: failed (Result: start-limit) since Thu 2020-03-05 21:47:37 CET; 1s ago
Process: 6122 ExecStart=/usr/bin/xbindkeys -X :0 (code=killed, signal=SEGV)
Main PID: 6122 (code=killed, signal=SEGV)
Mar 05 21:47:37 HOST systemd[1]: Unit xbindkeys.service entered failed state.
Mar 05 21:47:37 HOST systemd[1]: xbindkeys.service holdoff time over, scheduling restart.
Mar 05 21:47:37 HOST systemd[1]: Stopping "Xbindkeys Service to block keys"...
Mar 05 21:47:37 HOST systemd[1]: Starting "Xbindkeys Service to block keys"...
Mar 05 21:47:37 HOST systemd[1]: xbindkeys.service start request repeated too quickly, refusing to start.
Mar 05 21:47:37 HOST systemd[1]: Failed to start "Xbindkeys Service to block keys".
Mar 05 21:47:37 HOST systemd[1]: Unit xbindkeys.service entered failed state.
ExecStart
또한 다양한 방법으로 변경을 시도했습니다 .xbindkeys.service
ExecStart=/usr/bin/xbindkeys -X :0
그 중 어느 것도 작동하지 않으며 위와 같은 결과가 나옵니다.
DISPLAY=:0 xbindkeys
터미널에서 호출 하면 xbindkeys
예상대로 작동하고 종료할 때까지 백그라운드에서 프로세스로 실행됩니다.
~$ xbindkeys
~$ ps -ef | grep xbindkeys
user 6166 1 0 21:54 ? 00:00:00 xbindkeys
user 6168 3545 0 21:54 pts/1 00:00:00 grep xbindkeys
~$
또한 간단한 스크립트가 있는 경우:
#!/bin/bash
# start-xbindkeys.sh
DISPLAY=:0 xbindkeys
내가 스크립트를 호출하면./start-xbindkeys.sh
~$ ./start-xbindkeys.sh
~$ ps -ef | grep xbindkeys
user 6166 1 0 21:54 ? 00:00:00 xbindkeys
user 6168 3545 0 21:54 pts/1 00:00:00 grep xbindkeys
~$
xbindkeys
왜 을(를) 통해 실행할 수 없나요 systemd
?
저는 i386 Debian 8 Jessie 시스템에서 실행하고 있습니다.