Add systemd unit

Closes #39, #40.
This commit is contained in:
Chris Down 2017-02-17 11:45:03 -05:00
parent e85c7691e2
commit 662e31d618
2 changed files with 34 additions and 0 deletions

View file

@ -5,6 +5,9 @@ clipmenu is a simple clipboard manager using [dmenu][] and [xsel][].
Start `clipmenud`, then run `clipmenu` to select something to put on the
clipboard.
A systemd user service for starting clipmenud is included at
[init/clipmenud.service](https://github.com/cdown/clipmenu/blob/develop/init/clipmenud.service).
All args passed to clipmenu are transparently dispatched to dmenu. That is, if
you usually call dmenu with args to set colours and other properties, you can
invoke clipmenu in exactly the same way to get the same effect, like so:

31
init/clipmenud.service Normal file
View file

@ -0,0 +1,31 @@
[Unit]
Description=Clipmenu daemon
[Service]
ExecStart=/usr/bin/clipmenud
Restart=always
RestartSec=0
Environment=DISPLAY=:0
SystemCallFilter=@basic-io @default @io-event @ipc @network-io @process \
brk fadvise64 getegid geteuid getgid getgroups getpgrp \
getpid getppid getrlimit getuid ioctl mprotect rt_sigaction \
rt_sigprocmask setitimer setsid sysinfo umask uname wait4
# @file-system will handle this once v233 is released, see
# http://bit.ly/2l1r8Ah for more details.
SystemCallFilter=access chdir close faccessat fcntl fstat getcwd mkdir mmap \
munmap open stat statfs unlink
MemoryDenyWriteExecute=yes
NoNewPrivileges=yes
ProtectControlGroups=yes
ProtectKernelTunables=yes
RestrictAddressFamilies=
RestrictRealtime=yes
ProtectSystem=strict
ReadWritePaths=/tmp
[Install]
WantedBy=default.target