systemd is systemv times one hundred!
See all
Members (2,996)
Harald Hoyer's profile photo
Michal Sekletár's profile photo
Kay Sievers's profile photo
Lennart Poettering's profile photo
systemd's profile photo
Vincent Van der Kussen's profile photo
Glenn Holmer's profile photo
Kyungmin Park's profile photo
Donal Cahill's profile photo
Raphael Ludwig's profile photo
Bård Aase's profile photo
John Kwan's profile photo
John Salvatore Fontanelli's profile photo
Reiner Bühl's profile photo
Tony Nie's profile photo
Andy Webster's profile photo
Chester Moy's profile photo
Gabriel G's profile photo
Dhaval Giani's profile photo
Bernd Mueller (IanG)'s profile photo
Max N. Boyarov (zotrix)'s profile photo
Jean Jacques's profile photo
Anton “tony” Bangratz's profile photo
Dmitry Zinushin's profile photo


Join this community to post or comment
Hi, I use Arch Linux, I would like to run some scripts when there is any USB device mounted. I can write a script and keep looking for the output of mounts command. But, I would like to know any other possibility through systemd we can achieve this.
1. systemd.path unit file for keep monitoring for particular path.
2. something to do with systemd.device or systemd.automounter ?
3. Or can I create a unit file which can executed by systemd whenever something is got mounted ?

Daniel Rowe's profile photoGary van der Merwe's profile photo
systemd will not mount USB drives automatically by default.

If you usb drives are being automatically mounted, it is most likely being done by udisks. You can monitor this by running `udisksctl monitor`.

Add a comment...
I am doing some experimenting on creating services. While doing so I created a dummy daemon in C that does not work within systemd as long it contains a while loop. The daemon is running if I start it manually in a shell but on systemd it does nothing if it "runs".

You can see the source of the daemon here:

The daemon has been compiled using gcc -o foo foo.c -lsystemd and uses the service file you can take a look here:

Can anyone tell me what is going wrong here? Since this daemon is a rather stupid minimal example I was expecting it to just work.
Ubuntu Pastebin. Paste from tvn at Thu, 28 Jan 2016 16:11:11 +0000. Download as text. 1 2 3 4 5 6 7 8 9 10 11 12. #include #include #include int main(){ printf ("Booting up...\n"); while (true) { sleep (1); printf ("Tick\n"); } return 0; }. Download as text.
Andreas Henriksson's profile photoTheodor van Nahl's profile photo
While writing an answer I tested a few things and now everything works as I expected it to work -- with the code and .service mentioned in my post. Maybe I just forgot to do a systemctl --user daemon-reload for a longer period or there has been something else I cannot figure out anymore. Thank you both for your support! The checklist in man 7 daemon will help me a lot while experimenting further on.
Add a comment...

Is there a way to get the path of a signal with sd-bus?
I added the match with
sd_bus_add_match(), and i'm correctly receiving signals; but once i received the signal, i need to be able to get its path.


Federico Di Pierro's profile photo
Aaaand once more, i should wait more time before posting.
Sd_bus_message_get_path() should do the trick (i'm not able to test yet but i'm pretty sure it's the right function)!

Edit: yes, it is!
Add a comment...
I'm trying to get an udisks2 property through sd-bus.
I'm stuck: i cannot understand how to properly retrieve the reply message.

It is crashing on
"r = sd_bus_message_read(mess, "ay", &bytes);" .

Note that "&bytes" is just one of the solutions i tried, and i really have no more clues.
My purpose is to copy the bytes array as string in "s".

Obj_path is correct, as i printed and checked it (in fact the "sd_bus_get_property" call won't fail).

Any idea?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33. static void iso_backing_file(char *s, const char *name) { sd_bus_error error = SD_BUS_ERROR_NULL; sd_bus_message *mess = NULL; sd_bus *iso_bus = NULL; char obj_path[PATH_MAX + 1] ...
Federico Di Pierro's profile photo
found here a working example, my code now looks this way: It's working fine.
Add a comment...
Just an announcement. I've started work on a couple of system components (PAM module, systemd-controlled service, GDM greeter) that all together allow you to authenticate using the fingerprint scanner on your phone.

Currently this will probably only work with the Nexus 5X and 6P, which I have both here for testing (requires a small app on the Android side as well), but should work with any phone running Marshmallow or higher with a fingerprint scanner.

Goals are security and ease of use, in that strict order.

If anyone is interested in contributing in any way please feel free to contact me. Thanks for reading. 
Add a comment...

Charles Hymes

Discussion  - 
How to simulate shutdown to debug systemd unit?
I am trying to edit a config file to shutdown virtualbox guests when the host is shutting down. Stopping  must happen very early in the shutdown sequence, before any other services are stopped. It must also block other services from stopping, until this service is stopped. Trial and error on this is slow and painful. Is there a way to see the shutdown sequence without actually shutting down the host? Here is my config file:

Description=Start and correctly stop virtual guests
Requires=vboxdrv.service named-chroot.service vboxdrv.service named-chroot.service vboxdrv.service
Before=smb.service nmb.service winbind.service

ExecStart=/usr/lib/virtualbox/VBoxAutostart --background --start --config /etc/vbox/virtualbox.cfg
ExecStop=/bin/sudo /sbin/wait4poweroff --quiet

Charles Hymes's profile photoEnaut Waldmeier's profile photo
Well I think the solution might be to add requires dependencies in your service to all the filesystems it needs.

But it is only a guess I havn't actually written any service files dependent on filesystems. you could try asking on the mailinglist or on irc where the real pros live...
Add a comment...

Lindskog Work

Discussion  - 
Add a comment...

Harald Hoyer

Discussion  - 
It’s pretty easy to see what error messages have been logged on a machine with systemd installed: just run journalctl -p err. But this will show you all of the messages of priority “err…
Add a comment...

Dnk Dnk

Discussion  - 
Where is the best spot to get help with writing systemd scripts? I'm having my first crack at it, but I'm hitting some issues.
Dnk Dnk's profile photoarnaud gaboury (gabx)'s profile photo
+Dnk Dnk I may help you but please post your service files and how you start the service. I understand these are user services, right?
Add a comment...

Jacob Keller

Discussion  - 
A gotcha for those used to cloning Linux virtual machines when using systemd.

If you clone the image using just a simple disk-copy, it is possible that an already created /etc/machine-id will be copied to the clone, and all machines created from the same source will thus have an identical machine-id. This /etc/machine-id file is used as the source for various persistent but random things, such as persistently generated MAC addresses for virtual network devices.

It's pretty reasonable to have assumed in the past that you knew all of the bits to change when doing a disk copy clone, but today I think it would be recommended to use something like an installer kickstart file or similar to help avoid these issues.

Otherwise, you may be left (like I was) wondering why your MAC addresses on virtual functions were not as random as they were supposed to be.
Duncan Innes's profile photoJacob Keller's profile photo
I think it makes sense as an extension of the systemd first boot program
Add a comment...

About this community

A community for all things +systemd

Michael Heyns

Discussion  - 
I would like a file based filesystem to be mounted using a user .mount unit. But it fails with: mount: only root can do that

I am able to mount manually as the normal user.

Any advice?
Colin Guthrie's profile photoMichael Heyns's profile photo
+Noah Friedman unfortunately no selinux available on this kernel.

+Colin Guthrie​ Thanks for the insight. Do you think it is worth opening an issue on github? Maybe I should consult the mailing list.
Add a comment...

Ani Banerjee

Discussion  - 
Can anyone  help me with a networking issue please. I am assigning a dedicated interface to the container via "--network-interface=eth1". Now how do I set a static ip for the container? Do I need systemd-network configured? Cheers!
Add a comment...

Ahmed Kamal

Discussion  - 
Securing #centos 7 server with yum-cron (awesome) .. Sad there's no way to restart svcs/kernel when it makes sense. Any #systemd magic ? +Lennart Poettering ;)

Michael Chapman's profile photo
I should add that the idea of automatically restarting services just because their libraries got updated is pretty bonkers anyway.

What happens if a very low-level library gets updated, like glibc? Should every service be restarted? If not, are you now going to have to maintain some kind of blacklist so that only "safe" libraries trigger a restart?

What about processes that aren't associated with services, like things in people's login sessions?

And finally, the sort of search that needs-restarting and similar tools do is pretty naive. They simply look around for processes that seem to have library files open that are no longer present in the filesystem (i.e. have been replaced with a newer version). But that really only works with load-time-linked shared object libraries -- it doesn't help software that dynamically loads and unloads libraries at runtime, or software written in scripting languages that don't keep their library files open all the time.

There's a reason why needs-restarting (and similarly the "tracker" plugin for DNF) simply report the list of processes that might need restarting and leave it up to the sysadmin to decide what to do.
Add a comment...

Jonathan Kang

Discussion  - 
Does sd_journal_next(journal) functions the same as sd_journal_next_skip(journal, 1)?

Thanks in advance.
Frederic Crozat's profile photoJonathan Kang's profile photo
+Frederic Crozat Okay. Thanks for the help!
Add a comment...


Discussion  - 
Hi, can journalctl show logs in generating order instead of time order? I have a system without a battery and I need to read the latest generated logs.
Peter H.S.'s profile photo百合仙子's profile photo
+Peter H.S. Thanks. It shows monotonic timestamps, but does not sort by them so I have to sort them myself.

And I find that on my notebook, the logs at the beginning have larger monotonic timestamps (without any other options) than at the end (-n). Has it wrapped?

PS: it's strange that there are more reboot marks in the journal of my clockless system than the times it has actually rebooted.
Add a comment...

Trigger Hunag

Discussion  - 
Hi, I am new to sd-bus. As sd-bus is also a new API compared with dbus-glib, I can not find too detailed information about it. And also there are not enough comments in sd-bus.h. I just come here and want to ask some questions.  Would anyone can give me more information about the parameters of SD_BUS_METHOD/SD_BUS_PROPERTY, especially the '_signature' and '_result'.  I have found some examples in systemd source code, such as SD_BUS_METHOD("PullDkr", "sssssb", "uo", method_pull_dkr, SD_BUS_VTABLE_UNPRIVILEGED), but do not understand what's meaning of "sssssb" and "uo".
Thanks in advance.
Trigger Hunag's profile photo
+Lennart Poettering
 Hi Lennart, thanks for your kindly help.
Add a comment...

Marco Cavallini

Discussion  - 
May be worth reading it to increase the knowledge on this matter.
Structural and semantic deficiencies in the systemd architecture for real-world service management, a technical treatise. by V.R.. Preface and disclaimer (!) You're probably wide-eyed and gnawing at your teeth already. I was finally tempted into writing this from a Hacker News discussion on ...
Theophanis Kontogiannis's profile photoMatthew Usher's profile photo
Add a comment...
All of a sudden I can't `systemctl hibernate` as a user, without sudo.. What happened and how do I fix it?
Michael Chapman's profile photoHenrique Sant'Anna's profile photo
Same problem here, can't "systemctl hibernate" nor "systemctl suspend".
Add a comment...

Brian May

Discussion  - 
How do I debug timeout errors during boot starting dev-sdc1.device? Filesystem is btrfs. Timeout is 90 seconds, "time mount -a" returns in 1.985 seconds. I tried asking on local LUV mailing list, however only advice I got was to increase the timeout - I can't understand why it should take anywhere near 90 seconds however. As well as the typical unhelpful anti-systemd stuff. If I keep rebooting eventually it works (and is practically instant). What is it doing?
Cristian Ciupitu's profile photoBrian May's profile photo
This is Debian/stable (Jessie) using the supplied version of systemd - 215. If it is an older bug, would be nice to know what it is...
Add a comment...