1

I get this error message when I try to run systemd:

Failed to create /user.slice/user-1000.slice/session-c2.scope/init.scope control group: Permission denied

Failed to allocate manager object: Permission denied

When I try using sudo systemdI get this:

Trying to run as user instance, but $XDG_RUNTIME_DIR is not set.

Someone please tell me what I screwed up. Lol. Someone has asked this question before, but he did not get any answers, so I am asking again. I recently started tinkering with Linux due to this class I'm taking, but need a little help. Maybe there is some command I can use, or something i need to install?

I am using PuTTY to run my raspberry pi, with the CP2102 USB bridge connector from silabs. Current computer system is Windows 10.

The command "systemd" is the system/service manager. It's supposed to execute and show unit files, the core components + libraries...

I was able to execute it before and was able to analyze it where it showed me how long the core took to boot up, however, now it's not working that way. I'm thinking I've must have messed something up.

  • 1
    Where is the raspberry pi? Where do you get the error message? With journalctl? What is this systemd that doesn't run? It can't be the general init system. For what do you use sudo? systemd is running with root rights. Please explain a bit more in details what you want to achieve by editing your question. – Ingo Oct 20 '18 at 20:09
  • I've added more detail, I tried to explain the best I could, please forgive my lack of knowledge on the subject. – Symone Oct 20 '18 at 23:03
  • in a vanilla unmodified install I get the same output when running as root or pi - so, you haven't messed anything up ... I was able to execute it before ... before what? Are you perhaps thinking of systemd-analyze ? – Jaromanda X Oct 21 '18 at 1:55
3

I don't know what you want to achieve but as you can read in man systemd:

systemd is a system and service manager for Linux operating systems. When run as first process on boot (as PID 1), it acts as init system that brings up and maintains userspace services.
[..]
When run as a system instance, systemd interprets the configuration file system.conf and the files in system.conf.d directories; when run as a user instance, systemd interprets the configuration file user.conf and the files in user.conf.d directories. See systemd-system.conf(5) for more information.

You try to run it as user instance so you have to configure it with user.conf. If you try it without configuration you get the error message you show us. But I don't believe you really want to do that. It seems you are confused with the management tools of systemd. The most important are systemctl, journalctl, maybe systemd-analyze. For example with:

rpi ~$ systemd-analyze critical-chain

you get the timing of starting units and with

rpi ~$ systemctl list-dependencies

you get the dependencies of units. And most important is asking for the status of a service, e.g.:

rpi ~$ systemctl status console-setup.service
  • Worth mentioning in addition to "When run as first process on boot (as PID 1), it acts as init system that brings up and maintains userspace services", is that the init system, pid 1, in this case systemd, is always running thereafter and cannot be killed, (or at least, it will be immediately re-started by the kernel as PID 1 if killed). – goldilocks Oct 21 '18 at 17:37
  • I learn so much about systemd from reading your answers :) – Seamus Oct 21 '18 at 22:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.