With systemd, you can create a user service, so that you don't need root permissions to create the file and whatnot.
You create the .service file the same way, but without User=USER line, and change the WantedBy to default.target
Save this file to ~/.config/systemd/user/
Now, for all your systemd commands, instead of sudo systemd, do systemd --user.
Passionate full stack developer, course author for Educative, book author for Packt.
Find my work and get to know me on my Linktree: https://linktr.ee/thormeier
Passionate full stack developer, course author for Educative, book author for Packt.
Find my work and get to know me on my Linktree: https://linktr.ee/thormeier
I've been using it a lot for myself lately. I've only found two downsides.
I sometimes forget to add --user
The user instance of systemd doesn't start until the user's first login. So, if I need something to start right away, even if the user hasn't logged in yet, I need to use the system-wide systemd instead. This has never been a real issue to me, though, since I log in to my user as soon as I boot up the computer.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
With systemd, you can create a user service, so that you don't need root permissions to create the file and whatnot.
You create the
.servicefile the same way, but withoutUser=USERline, and change theWantedBytodefault.targetSave this file to ~/.config/systemd/user/
Now, for all your
systemdcommands, instead ofsudo systemd, dosystemd --user.So:
After reboot, it'll start up when you log in.
And when you want to read the logs, just do
journalctl --user -u mutebutton.Here's some more info: wiki.archlinux.org/index.php/syste...
Thank you for this hint, I wasn't aware of this being possible! Is there any drawbacks to this?
I've actually been using
systemdto replace my user's crontab recently as well.Oh wow, didn't know this was possible, either! I really need to dig deeper into
systemdthen, thank you!I've been using it a lot for myself lately. I've only found two downsides.
--usersystemddoesn't start until the user's first login. So, if I need something to start right away, even if the user hasn't logged in yet, I need to use the system-widesystemdinstead. This has never been a real issue to me, though, since I log in to my user as soon as I boot up the computer.