reddit / emacs
how to start emacsserver on boot with systemd and not have it terminated on logout? Rant! Vent!
klikklakvege · 2022-12-12 01:26
[removed]
db48x · 2022-12-12 03:18
Your poor attitude makes it hard to want to help you, but what you want to do is run `loginctl enable-linger`. From the man page:
enable-linger [USER...], disable-linger [USER...]
Enable/disable user lingering for one or more users. If enabled for a specific user, a user manager is spawned for the user at boot and kept
around after logouts. This allows users who are not logged in to run long-running services. Takes one or more user names or numeric UIDs as
argument. If no argument is specified, enables/disables lingering for the user of the session of the caller.
See also KillUserProcesses= setting in logind.conf(5).
You might also need to change the WantedBy= line for emacs.service so that it starts at boot instead of when you first log in. Every distro has their own set of targets, so you may need to poke around to figure out what they are. Your distro should document them somewhere. `systemctl --user list-units -t target` might get you started.
RipKord42 · 2022-12-12 03:35
Why don't you run a distro that doesn't use systemd?
klikklakvege · 2022-12-12 03:50
poor or not, I'm looking for a way to not have to read systemd docs at all, because imo the stuff i'm asking for shouldn't need to be documented but be self explanatory. I did come along the enable-linger option, but as far as i know the --user option is something new in systemd and there was a life before --user and before lingeringAu sure that my problems will be solved when i set this option? Or maybe it's the killuseroption?
Do i really have to check the systemctl --user list-units -t target?
Are you sure that this won;t involve reading more docs about all capabilities and options of systemd? Do you understand that exactly that's what i don't want anymore?
Did you understand my problem? I'm sick of dealing with systemd. Unfortunately it got popular. Similar like windoze was once and all had to suffer. I removed windows from my life and the pain stopped. Now it's systemd. I know that there are ways to install and configure other initiakisation systems. It all takes time. I'm interested in emacs and lisp. Not systemd. And mathematics and arts. **But not systemd.** I don't want to be forced to examine outputs of systemctl and think whether i should use service or systemctl and think about units and targets and how all of this is configured on my system. Ican setup a system for me without systemd, but systemd will get me some day anyway, it's everywhere nowadays :(
I'm not interested in reading systemd docs and all these outputs. I gratefully thank you for your time and your positive attitude, but it didn't help. I don;lt want to study systemd anymore because i consider it a waste of my time. I know since years that there are life philosophies incompatible with me. Systemd is based on one of those. I suffer. You suggest to suffer more and do more systemd. No. I've got enought. It's too sophisticated for me.
Lisp is compatible with me. Systemd is not. Windows is not. I would rather do a new install then examine this systemctl mess. If something can't be put into a similar form as to (do-this-stuff), eventually do-that-stuff(emacs), then it's bad software (in my very personal opinion).
I'm sure that there are hackers around who implemented a my-personal-solution-of-the-systemd-problem. Others who hate systemd and implemented a bypass, that's what i'm looking for. A way to not have to deal with systemd stuff even if it's systemd what runs this computer. My preffered solution would be to start emacs asap and run the show from there. I spent hours and was not able to get even to this. The most basic usage of a startup system. I searched it. Nobody knows. There are only millions of examples and the manuals. I still don't know how it works and i gave up.
It steals my time, that's what systemd is for me. A thief of my time.
I need (bypass-the-systemd-horrors)
redguardtoo · 2022-12-12 03:52
My `/home/cb/.config/systemd/user/emacs.service`,
```
[Unit]
Description=Emacs text editor
Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/
[Service]
Type=forking
ExecStart=/home/cb/myemacs/28.1/bin/emacs -Q --daemon -l "/home/cb/.emacs.d/early-init.el" -l "/home/cb/.emacs.d/init.el" --eval "(progn (require 'server) (server-start))"
ExecStop=emacsclient --eval "(kill-emacs)"
Environment=SSH_AUTH_SOCK=%t/keyring/ssh
Restart=on-failure
[Install]
WantedBy=default.target
```
Use `systemctl --user restart emacs.service` or `systemctl --user status emacs.service` to restart/check the service.
Check systemctl manaul for more setup.
BTW, there are some books on tldp.org, teaching basic Linux shell&cli knowledge.
klikklakvege · 2022-12-12 04:09
I have my stuff on linode. Not every distro is available there. The nonsystemd options seem to be Slackware, but this would require to fiddle around with installing docker(which i need). Alpine is also there, i guess that alpine is without systemd but i could have later other incompatibility problems because of libc.
Yes, in the future of course i have to settle on a distro without systemd. But systemd is so popular that this problem will come back again. And it's really a shame that so few share my opinion that this should be as simple as "add-to-startup emacs --daemon". **Nothing more**. Reading systemd manuals is less fascinating then reading the telephone book for me. I really can;t understand why they force people to study their docs, as if systemd is the most fascinating thing on earth and everyone is absolutely delighted and pleasured to study it's internals. Yuck.
The popularity of systemd in linux is really a reason for me to stop using it(after more then 20 years!!). Maybe i should move my stuff away from linode to some freebsd vps.
Thanks for the suggestion!
[deleted] · 2022-12-12 04:14
[removed]
db48x · 2022-12-12 04:34
> imo the stuff i'm asking for shouldn't need to be documented but be self explanatory
Everyone wants their computer to intuit what they want these days, but computers have never been able to do that. Man up and read the documentation.
> Do i really have to check the systemctl --user list-units -t target?
You may remain ignorant as long as you like.
I’m not going to read the rest of your ramble.
klikklakvege · 2022-12-12 05:03
i did it like that. But without so many options with emacs. Just emacs --daemon. You run --daemon, interprete two elisp files and add a script in the command line to do (server-start). Why do you attempt to start the emacs server twice?
Are you sure that your emacs isn't killed when you log out? I used all these commands. Thank you, i teached basic linux shell&cli at the university. I think i know the basics.
Above solution didn't preserve the emacs process on logout. I run some servers as child processes from emacs. They work as long as i'm logged in. Emacs works. I log out of the system and server started by emacs is down. Probably you don't start background processes with emacs which are supposed to run all the time. Because you need emacs only when you log in. To do text editing stuff. I use emacs as the operating system so i have different requirements.
BTW i wrote specifically in this post that **i'm not interested in reading systemctl manuals**. I read all the stuff that lead to the solution you have(and that is repeated all over). It does not work and i'm not interested and reading more systemd manuals because i already know that this system is not for me. I don't like windows, i don;t like android and i don't like systemd. All these systems are only good in wasting my time
I don;t think that reading tldp would help me here since as i already wrote several times, i'm not interested in reading more about systemd. I already hate it. I'm looking for a solution that does not involve dealing with it. I also don't like git. Maybe you do. Everybody loves git. I don't.
btw The headline of this topic contains the words "rant" and "vent". Are you sure that you understood their meaning? I think the lisp 1.5 manual is excellent literature. Or essays written by Richard Stallman. Or random wikipedia articles. **But not systemd.** And not over and over the same solution that you posted here. One that does not work here.
Nobody knows how systemd works and it is nowhere good explained. Because it's not a good system. If you can't explain it to a kid the you don't understand it. Why don;t you understand systemd? Because it sucks.
klikklakvege · 2022-12-12 05:15
of course they have. Simple systems make less problems then complex ones I read enough systemd docs to know that the system sucks. Reading more will not help here.
systemctl --user list-units -t target also did not help here. It only convinced me agian and again that this system is not for me.
Man up and read at least read and understand the problem that you comment. Otherwise what's the point? I'm talking about X and you don't read X and say Y.
You may remain ignorant as long as you like.
codemuncher · 2022-12-12 05:15
To be fair, I've never heard anything good about the systemd documentation!
One thing I find that is common among systems documentation is there is a missing piece, a "what does this thing even do, how does it do it, and where are config files?" -- its such basic information that the doc writers skip it and go straight to writing about every config feature. I have seen this common doc anti-pattern repeated over and over and over.
​
Note the top most comment said "your distro should have it documented somewhere" --> where exactly? In a man page? In an info file? In the source code not included by default?
​
Yeah the OP is annoyed and pissy, but I mean come on... have you even used systemd???
klikklakvege · 2022-12-12 05:35
Exactly!!! Just compare it with bsd. It is really possible to have it simple. I really cannot understand why the linux community choose this beast. I read once a interview with poettering about systemd. He complained about the audiostack in linux. Awesome. So i have now a better audio stack(which i don;t care at all) at the expense of having to deal with much more complex startup system that isn't explained anywhere properly. I didn't have these problems with slackware or freebsd. Simple stuff should be simple. It was simple. It isn't anymore.
Poettering gets even death threats!!!! So many people are pissed.
I posted it here because emacs initialisation is simple. Put it into .emacs. Done. That's what i like in emacs. You can wrap everything up in one function call.
Do simple stuff with systemd? Nobody knows how and no amount of reading the docs will change that. The only way people deal with systemd is by copy&paste. Nobody knows how that stuff works. If people would actually use it then they would know. They don't. So they don;t know that this system sucks.
There are other init systems. Maybe they lead to a worse audio stack.
_viz_ · 2022-12-12 05:38
>Note the top most comment said "your distro should have it documented somewhere" --> where exactly? In a man page? In an info file? In the source code not included by default?
Which comment did? The top most comment on my end quoted the manpage, the other comments have nothing that implies go read the docs. I don't understand your complaints.
no-dupe · 2022-12-12 06:55
I think you should hire someone to solve your problems. It would not involve reading anything and depending on how much you pay the person will be happy to hear also your rants about systemd. Or you can try a distro without systemd, like https://exherbo.org.
klikklakvege · 2022-12-12 07:21
"All design goals must be phrased in such a way that it is hard to use them as slogans to justify stupidity.
The target users know what they are doing."
I really like that. I don't think my systemd problems will last long. If i would intent to use systemd they would. But i don;t :) It starts emacs and that's it.
And the fact that Eric Raymond agrees with me as to systemd is proof enough for me that it's not me who is the idiot. And it has to be said again and again:
The emperor wears no clothes and systemd sucks. Linux would be better of without it.
I just checked the docs of exherebo. No. I will not edit fstab. No f\*ing way. That's not an option. I know what i am doing and i won't waste time to edit fstab. Nor will i pay anybody to edit fstab. It's immoral
db48x · 2022-12-12 07:46
> Note the top most comment said "your distro should have it documented somewhere" --> where exactly? In a man page? In an info file? In the source code not included by default?
When you choose a distribution, you should judge it partly on the quality of its documentation. Do they just include the stock man pages, or do they augment them with information specific to the particular choices they have made, such as specific targets that they have added/modified/removed/etc?
I use Fedora for some things, and they have a System Administrator’s Guide (https://docs.fedoraproject.org/en-US/fedora/latest/system-administrators-guide/) which they update for each release. It’s not as detailed as I would like, but it’s where I start.
Since I don’t know much about the thousands of other distros that are out there, I leave it to their users to know about their documentation.
pk2374 · 2022-12-12 08:32
There is no problem installing docker on Slackware. I have it up and running.
redguardtoo · 2022-12-12 09:28
I'm not an expert of systemctl. The setup might be copied from emacswiki or elsewhere. But it does work at my computer.
I don't quite understand why you have those login/logout issue. I run `systemctl --user enable emacs.service` to enable the service during boot time. You could try my "emacs.d" https://github.com/redguardtoo/emacs.d, see if you can reproduce the issue.
Awkward_Tradition · 2022-12-12 12:21
This is some next level entitledness: "man up and read my wall of rant so you can help me for free because I've decided it sucks and so don't want to read the docs". The best part is that if you skipped the rant and clearly explained what you're trying to do you wouldn't even need to touch systemd.
nandryshak · 2022-12-12 12:44
>Yeah the OP is annoyed and pissy, but I mean come on... have you even used systemd???
Yes, for the last 10 years. I like it a lot and I think that the unification it brought is one of the best things ever to happen to Linux.
I think the vast majority of the hate it gets is absolutely asinine, and OP is one of the worst examples I've seen in recent memory.
[deleted] · 2022-12-12 13:23
I'm not a fan of SystemD either, but goddamn, calm down. Switch to a different init system and stop whining
klikklakvege · 2022-12-12 13:55
Yes, I read the docs. Systemd sucks. Eric Raymond agrees with me. Yes, I'm entitled to run the most awesome operating system on the planet on my laptop. Because it's free software. Because I deserve it. And the init system should also be awesome and not suck. Crapware shouldn't have that much support in the linux community. And definitely not in the emacs community. Does emacs suck? No. Emacs rocks. Does linux suck? No, linux is awesome. Does systemd suck? Yes, big time. Can you say anything good about systemd? No. Do you know anybody who can say anything good about systemd? No. Is there any reason to made this system complex instead of simple? Yes, if you are used to program in C++ and think that C++ is a good language and windows 98 a good operating system then you may also think that systemd should be complex instead of simple. Look at the emacs initialisation. It's simple. Or look at the docs of caddy reverse proxy. Also simple.
The best part is where you did not understand that i clearly explained what i'm trying to do. I see. I use to many words and people who are not used to read get lost.
klikklakvege · 2022-12-12 14:12
So would you like your desktop/laptop linux to become what android became? This will happen if we tolerate bloatware. Do you really think systemd will be better with time?
Of course i switch to a different init system, Emacs init system.
[deleted] · 2022-12-12 14:52
[removed]
hagerty9009 · 2022-12-12 14:54
[Install]
WantedBy=multi-user.target
in your emacs unit file. That's a pretty common "run this thing even if no one is logged in" target.
emacs-ModTeam · 2022-12-12 19:04
A short question about emacs with 75% of the post being a rant against systemd is not really on topic, here.
Feel free to repost your actual emacs question with the rest removed, but you know you already have your answer in `loginctl enable-linger` for the user.
emacs-ModTeam · 2022-12-12 19:05
This has been removed, as it is not very civil; please attack ideas, not people.
emacs-ModTeam · 2022-12-12 19:06
This has been removed, as it is not very civil; please attack ideas, not people.