vim /usr/lib/systemd/system/dropbox.service添加一个用户登陆后启动的服务
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
[Unit] Description=Dropbox as a system service user
[Service] Type=forking ExecStart=/usr/bin/dropbox start ExecStop=/usr/bin/dropbox stop User=nobody Group=nobody # 'LANG' might be unnecessary, since systemd already sets the # locale for all services according to "/etc/locale.conf". # Run `systemctl show-environment` to make sure. #Environment=LANG=en_US.utf-8