[systemd-devel] Using Systemd "FD Store" facilitiy
Hi, I had previously sent a mail on this but got no response, so wanted to check again. I am trying to use systemd as a way to store and restore the FDs used by a service, so that the service can provide continuation of service during an upgrade. for the purpose of trying it out, I am using a simple TCP echo server as my service The issues I see are : 1. I store the fds using sd_pid_notify_with_fds, and then do a systemctl restart of the service. Then I use sd_listen_fds and get all the fds back and the service continues without disturbance. But the problem is a. systemd continues to hold all these fds, so now if my service is done with the fd and closes the connection, this is not getting through to the client, as systemd continues to have this fd b. Even if the client closes the connection, my service gets it and closes the connection but systemd still holds on to this fd. so in essence once I store the fd with systemd using sd_pid_notify_with_fds, they do not go away untill I do a systemctl stop of my service This is making it difficult to use this service in the intended way. It would be nice if on sd_listen_fds, the sytemd passes all fds back to the service and internally cleared its state, so that only the service has the fds. (this is ofcourse only for those fds that the service had previously send in sd_pid_notify_with_fds, the other fds that the service gets as part of socket activation would continue to be held in systemd also.) Let me know if this sounds correct, or am I mis-understanding the way this service is to be used. Thanks Jana ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] How to prevent an initramfs service from being stopped at switch-root ?
On 11/01/16 13:09, Tomasz Torcz wrote: > On Mon, Jan 11, 2016 at 12:39:10PM +, John Lane wrote: >> I have some services in my initramfs that unlock some crypto volumes to >> make the root and some other filesystems available. > This seems relevant: > https://wiki.freedesktop.org/www/Software/systemd/RootStorageDaemons/ > Yeah, I read that. But it doesn't explain how to configure a unit. I read the bit about processes where the first character of the zeroth command line argument is '@' are excluded from the killing spree, but not sure how to do that from a unit specification file. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] How to prevent an initramfs service from being stopped at switch-root ?
On Mon, Jan 11, 2016 at 12:39:10PM +, John Lane wrote: > I have some services in my initramfs that unlock some crypto volumes to > make the root and some other filesystems available. This seems relevant: https://wiki.freedesktop.org/www/Software/systemd/RootStorageDaemons/ -- Tomasz TorczOnly gods can safely risk perfection, xmpp: zdzich...@chrome.pl it's a dangerous thing for a man. -- Alia ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] How to prevent an initramfs service from being stopped at switch-root ?
I have some services in my initramfs that unlock some crypto volumes to make the root and some other filesystems available. Looking at the journal, I can see that the initramfs (at switch-root time) tries to kill these services but this fails because the filesystems are mounted by this point. I would like these services not to be killed at switch-root time. How can I mark them such ? ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] info request
hi, i'm new in Linux, so I need help. My Debian 8.1 doesn't load, I have some message failure on the boot of Debian. I'm looking in the rescue mode, in the journal (log) and I see 4 message of failure in red. Look at them: Failed to start LSB: NFS support files common to client and server - Subject: units nfs-common.service has failed - Defined-By: systemd - Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- user system [474]: Failed at step EXEC spawning /usr/sbin/alsactl: No such file or directory - subject: Process /usr/sbin/alsactl could not be executed - Defined-By: systemd - Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel - - The process /usr/sbin/alsactl could not be executed and failed - - The error number returned while executing this process is 2 -- user system [475]: Failed at step EXEC spawning /usr/sbin/acpid: No such file or directory - subject: Process /usr/sbin/acpid could not be executed - Defined-By: systemd - Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel - - The process /usr/sbin/acpid could not be executed and failed - - The error number returned while executing this process is 2 - user system [475]: Failed at step EXEC spawning /usr/sbin/cupsd: No such file or directory - subject: Process /usr/sbin/cupsd could not be executed - Defined-By: systemd - Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel - - The process /usr/sbin/cupsd could not be executed and failed - - The error number returned while executing this process is 2 - user system [475]: Failed at step EXEC spawning bin/plymouth: No such file or directory - subject: Process bin/plymouth could not be executed - Defined-By: systemd - Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel - - The process bin/plymouth could not be executed and failed - - The error number returned while executing this process is 2 - so... I see that in this rescue mode on Debian 8.1 it is used GNU Bash - for shell I need to know if it's possible under this GNU Bash to install alsa - utils package .deb format: wget http://ftp.us.debian.org/debian/pool/main/a/alsa-utils/alsa-utils_1.0.28-1_amd64.deb dpkg -i alsa-utils_1.0.28-1_amd64.deb but I see that doesn't work command of wget and dpkg so... How I can install my package, such that to do it from GNU Bash, rescue mode in Debian 8.1. can you give me an procedure or other links to learn how I will do it. And I hope to solve of this problem and Debian to boot normal. Thank you, and I waiting your response I don't know what other methods are to resolve this. Can you help me with information. -- *o zi frumoasa !Robert - Nicolae MOREANU* ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] How to prevent an initramfs service from being stopped at switch-root ?
On Mon, Jan 11, 2016 at 3:38 PM, John Lanewrote: > On 11/01/16 13:09, Tomasz Torcz wrote: > > On Mon, Jan 11, 2016 at 12:39:10PM +, John Lane wrote: > >> I have some services in my initramfs that unlock some crypto volumes to > >> make the root and some other filesystems available. > > This seems relevant: > > https://wiki.freedesktop.org/www/Software/systemd/RootStorageDaemons/ > > > Yeah, I read that. But it doesn't explain how to configure a unit. I > read the bit about processes where the first character of the zeroth > command line argument is '@' are excluded from the killing spree, but > not sure how to do that from a unit specification file. This is primarily meant to be done by daemons themselves, and I'm really not sure if it works when done "externally" from a .service – but worth a try: ExecStart=@/usr/bin/myservice @myservice --option --option KillMode=none (The two "@"s have different meanings – the first one is documented in systemd.service, the second in RootStorageDaemons.) -- Mantas Mikulėnas ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Subprocess
On Mon, Jan 11, 2016 at 07:58:30PM +0300, Mihamina RAKOTOMANDIMBY wrote: > Hi all, > > Walking trhough my virtual machines, I noticed something strange: > The sensu process is inside the CFEngine CGroup. > > This is mainly because of the way I launch Sensu after install > > Please have a look at > https://bitbucket.org/snippets/rakotomandimby/nLkaM > > How should I launch Sensu on systemd enabled system in order to have it > in a dedicated CGroup? Should I create the service file and start it > instead? Yes, that would be preferable. But you can use systemd's SYSV compatibility and replace lines 4 and 5 by: "sensu[command][start]" string => "/bin/systemctl start sensu-client"; "sensu[command][restart]" string => "/bin/systemctl restart sensu-client"; -- Tomasz TorczOnly gods can safely risk perfection, xmpp: zdzich...@chrome.pl it's a dangerous thing for a man. -- Alia ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] How to prevent an initramfs service from being stopped at switch-root ?
On Mon, 11.01.16 13:38, John Lane (syst...@jelmail.com) wrote: > On 11/01/16 13:09, Tomasz Torcz wrote: > > On Mon, Jan 11, 2016 at 12:39:10PM +, John Lane wrote: > >> I have some services in my initramfs that unlock some crypto volumes to > >> make the root and some other filesystems available. > > This seems relevant: > > https://wiki.freedesktop.org/www/Software/systemd/RootStorageDaemons/ > > > Yeah, I read that. But it doesn't explain how to configure a unit. I > read the bit about processes where the first character of the zeroth > command line argument is '@' are excluded from the killing spree, but > not sure how to do that from a unit specification file. This should be done by the daemons themselves. It's really nothing you can do properly from the outside. If daemons shall run from the initrd, they must be prepared for that, for example never access /var and not assume tmpfiles was run or suchlike. They must be able to deal with the root file directory being pivoted away and suchlike. hence: it's really not as easy as just taking a daemon and calling it slightly differently -- instead the daemon must be designed for this mode of operation, in which case it should implement the @ logic natively. Lennart -- Lennart Poettering, Red Hat ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] Subprocess
Hi all, Walking trhough my virtual machines, I noticed something strange: The sensu process is inside the CFEngine CGroup. This is mainly because of the way I launch Sensu after install Please have a look at https://bitbucket.org/snippets/rakotomandimby/nLkaM How should I launch Sensu on systemd enabled system in order to have it in a dedicated CGroup? Should I create the service file and start it instead? Thank you. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] How to prevent an initramfs service from being stopped at switch-root ?
On 11/01/16 16:44, Lennart Poettering wrote: > On Mon, 11.01.16 13:38, John Lane (syst...@jelmail.com) wrote: > >> On 11/01/16 13:09, Tomasz Torcz wrote: >>> On Mon, Jan 11, 2016 at 12:39:10PM +, John Lane wrote: I have some services in my initramfs that unlock some crypto volumes to make the root and some other filesystems available. >>> This seems relevant: >>> https://wiki.freedesktop.org/www/Software/systemd/RootStorageDaemons/ >>> >> Yeah, I read that. But it doesn't explain how to configure a unit. I >> read the bit about processes where the first character of the zeroth >> command line argument is '@' are excluded from the killing spree, but >> not sure how to do that from a unit specification file. > This should be done by the daemons themselves. It's really nothing you > can do properly from the outside. > > If daemons shall run from the initrd, they must be prepared for that, > for example never access /var and not assume tmpfiles was run or > suchlike. They must be able to deal with the root file directory being > pivoted away and suchlike. hence: it's really not as easy as just > taking a daemon and calling it slightly differently -- instead the > daemon must be designed for this mode of operation, in which case it > should implement the @ logic natively. > > Lennart > Let me explain my scenario to you, perhaps I am doing something wrong... I have a "cryptsetup@.service" that is symlinked as cryptsetup@some_disk.service that unlocks a crypto-disk containing the root filesystem. Mounts then happen as they should, and everything works. Then, when the switch root happens, systemd tries to kill the above service. This fails because it is busy due to the underlying filesystem being mounted. This leaves the unit in a failed state. After the switch root, systemd tries to start the unit but this fails because the device mapper is already assigned. The net result is the system's always "degraded" with "cryptsetup@some_disk.service" in a failed state (despite everything being fine). I'm using a cryptsetup@.service unit instead of /etc/crypttab because I needed to use cryptsetup options that the latter didn't support when I implemented it. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel