bash - How to start a systemd service after user login and stop it before user logout -
i have fedora 23 machine.
i have directory/file synchronizing bash script synchronizes local /home directory remote directory (in nas machine). run manually create systemd service , make more flexible, since other people use pc own user credentials, 'd know when user logged in , start service afterwards.
is there can service's systemd file or have check code in script?
my main source of documentation link https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/sect-managing_services_with_systemd-unit_files.html
edit: don't know if make easier resolve it, need make sure have access environment variables (like $user) , run service.
Comments
Post a Comment