3 ms·
> I want to edit a service to harden it for example. Oh, wait I shouldn't edit it directly with vi? Because it gets overwritten by package updates. I don't thi
by ayushnix 5y ago
> I want to edit a service to harden it for example. Oh, wait I shouldn't edit it directly with vi? Because it gets overwritten by package updates.
I don't think you're supposed to edit anything inside /usr, except perhaps /usr/local, but even that has a better alternative in the form of $HOME/.local, which is a well defined standard at this point.
Maybe I'm unaware or mistaken but if you're editing anything inside /usr as a normal user, you're either using Linux wrong or doing something unexpected or unusual. This is why requests to make GUI file explorers have root escalation capabilities sound absurd to me. I can't think of a reason why one would need root access when using a file manager, especially a GUI file manager.
- 0xdeadb00f 5y ago> Maybe I'm unaware or mistaken but if you're editing anything inside /usr as a normal user, I'm not doing any of this as a normal user. I'm doing all of this as root
- ayushnix 5y agoEven in that case, if you're manually editing anything inside /usr either by being root or by using sudo, you're doing something wrong or unexpected. Anything inside /usr should only ever be modified by the package manager, not by the root user, or any other user for that matter. If you want to make system wide changes, make them in /etc. If you want to make user specific changes, make them in $HOME/.config, $HOME/.local. Your package manager should never overwrite anything in /etc or $HOME. If it does, it's a bug.
- 0xdeadb00f 5y agoSo here's the thing, right. You are correct. And I agree. I'll admit something; I forgot where the service files were (I don't use systemd often). So, in my unix wisdom I used `find` to find the files ending with 'service'. The only ones that came up were in /usr/lib You're right, I'd typically never edit files in /usr. But I wasn't sure how else to do it at the time.