commit 28d8db8860ef823041a138c8757a6025286fb049
parent d8dbb1d5af93eb6e89b0cb38f401a4bce38e4425
Author: Chris Down <chris@chrisdown.name>
Date: Fri, 17 Mar 2017 01:18:29 +0000
clipmenud: Time out all calls to xsel after 1 second
I'm not entirely sure how this happens, but sometimes xsel gets rather
stuck:
% systemctl --user status clipmenud
● clipmenud.service - Clipmenu daemon
Loaded: loaded (/usr/lib/systemd/user/clipmenud.service; disabled; vendor preset: enabled)
Active: active (running) since Wed 2017-03-15 11:14:14 GMT; 1 day 13h ago
Main PID: 31630 (clipmenud)
CGroup: /user.slice/user-1000.slice/user@1000.service/clipmenud.service
├─ 9052 /bin/bash /usr/bin/clipmenud
├─ 9053 xsel --logfile /dev/null -o --primary
└─31630 /bin/bash /usr/bin/clipmenud
Mar 15 11:14:14 gongzuo systemd[474]: Started Clipmenu daemon.
% strace -p 9053
strace: Process 9053 attached
restart_syscall(<... resuming interrupted restart_syscall ...>^Cstrace: Process 9053 detached
<detached ...>
% ps aux | grep 9053
cdown 9053 0.0 0.0 15956 896 ? S Mar15 0:00 xsel --logfile /dev/null -o --primary
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clipmenud b/clipmenud
@@ -7,7 +7,7 @@ lock_file=$cache_dir/lock
lock_timeout=2
_xsel() {
- xsel --logfile /dev/null "$@"
+ timeout 1 xsel --logfile /dev/null "$@"
}
get_first_line() {