0

last time i delete the folder system in /usr/lib/systemd/system.I don't know how, but how important is the folder system for the ubuntu server 18.04 ? What consequences should I expect?

kind regards,

blackbeard

beard black
  • 67
  • 2
  • 11

3 Answers3

2

Do this possibly destructive thing on a test system and see what happens. Either a host created for this purpose, or something with a known recovery plan.

A reason for uncertainty here would be that Fedora and EL try very hard to move all the things to /usr. On CentOS 7, /usr/lib/systemd/system definitely contains system units, and removing all of them would cause the system to not function.

Per Ubuntu's man page, they have not done it quite the same and have /lib/systemd/system. Why exactly /usr/lib/systemd/system exists on Ubuntu I don't know. Look at whether its contents are a symlink to the actual location, or perhaps a couple misplaced units that are not packaged to Ubuntu's conventions.

On a system with package management, ideally /usr and /lib are only managed by installing and removing packages, with no need to directly deal with files. systemd's search paths support this very well, for example /etc/systemd/system/ is a good place for local custom units and overrides.

John Mahowald
  • 30,009
  • 1
  • 17
  • 32
1

The folder /lib/systemd/system contains all configuration files for systemd. If you deleted the content of this directory, your system might never boot again.

The folder /usr/lib/systemd/system might be a symbolic link for /lib/systemd/system. If it wasn't everything should be alright, since it is not on systemd's search path. The question is why was there a /usr/lib/systemd/system in the first place.

Piotr P. Karwasz
  • 5,292
  • 2
  • 9
  • 20
  • i dont know, maybe default installation from my ubuntu headless server 18.04 . You mean the folder /usr/lib/systemd/system is unimportant. I understand from wiki the systemd for user unit should be us for session service like delete all temporary file after log out from server. Im using only lib/systemd/system and etc/systemd/system. – beard black Feb 01 '20 at 00:25
  • `/usr/lib/systemd/system` is not on the search path, but `/usr/lib/systemd/user`, where user units are stored, is! – Piotr P. Karwasz Feb 01 '20 at 06:48
  • What you mean? Is the folder now important? – beard black Feb 01 '20 at 08:24
  • `/usr/lib/systemd/user` contains user units and is important, `/usr/lib/systemd/system` does not exist or serve a purpose on a Debianoid. – Piotr P. Karwasz Feb 01 '20 at 15:52
0

I found my Problem, i created my own system file in usr/lib/systemd/System. Thanks everbody.

beard black
  • 67
  • 2
  • 11