[systemd-devel] MemoryLimit for user unit
Hi systemd-users, I tried to add a memory limit for a user service unit (inspired by [1]), it looks like: [Service] # MemoryAccounting=true MemoryLimit=1G Now the problem is that the (user) service consumes more than 1G without being terminated. htop shows a memory consumption of 1.4 GB. The output of `systemd-cgtop` is: Control Group Tasks %CPU Memory Input/s Output/s / -1.5 1.7G- /user.slice 460.414.3M- /user.slice/user-1001.slice 460.414.2M- /init.scope 1 - 1.4M- /system.slice So my question is how would MemoryLimit= work for a user unit? My system is Debian 9 with systemd: $ systemctl --version systemd 232 +PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN Thanks in advance + regards. Stefan [1] http://0pointer.de/blog/projects/resources.html ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] How to allow a user to use journalctl to see user-specific systemd service logs?
On 03.10.2016 20:59, Daniel Ng wrote: > journalctl --user -u test.service > Hint: You are currently not seeing messages from other users and the > system. > Users in the 'systemd-journal' group can see all messages. Pass -q to > turn off this notice. > No journal files were opened due to insufficient permissions. > I could reproduce the problem on a Ubuntu 16.04 system with systemd 229. Please also have a look at this issue on GitHub [1]. Regards, Stefan [1] https://github.com/systemd/systemd/issues/3281 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] How to allow a user to use journalctl to see user-specific systemd service logs?
On 03.10.2016 20:59, Daniel Ng wrote: > I am running user-level services in Ubuntu 16.04 LTS. For example, I have > my test.service located at ~/.config/systemd/user/test.service > > I was able to run the service by doing > > systemctl --user start test.target > Hi Daniel, did you really use test.target? Target files are usally used for grouping units [1]. I tried to create a test.service file in ~/.config/systemd/user and started it with: systemctl --user start test.service Then it is possibly to use journalctl --user both with: journalctl --user -u test journalctl --user -u test.service Tested with systemd 231 - what systemd version do you use? Cheers, Stefan [1] https://www.freedesktop.org/software/systemd/man/systemd.target.html ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Failed to start Container: minus sign is replaced to slash in container name
Am 02.06.2016 um 01:27 schrieb Stefan Schweter: > Hi Lennart and all other systemd users, > > I tried to enable + start a container named debian-sid. E.g. the > following command works without any problems: > > systemd-nspawn -M debian-sid > > Then I used the machinectl tool for enabling the container: > > [root@build ~]# machinectl enable debian-sid > Created symlink > /etc/systemd/system/machines.target.wants/systemd-nspawn@debian\x2dsid.service > → /usr/lib/systemd/system/systemd-nspawn@.service. > > When starting the container: > > [root@build ~]# machinectl start debian-sid > Job for systemd-nspawn@debian\x2dsid.service failed because the control > process exited with error code. > See "systemctl status "systemd-nspawn@debian\\x2dsid.service"" and > "journalctl -xe" for details. > > The output of the journalctl is: > > Jun 02 01:21:40 build.name.eu systemd-nspawn[6477]: Invalid machine > name: debian\x2dsid > Jun 02 01:21:40 build.name.eu systemd[1]: > systemd-nspawn@debian\x2dsid.service: Main process exited, cod > Jun 02 01:21:40 build.name.eu systemd[1]: Failed to start Container > debian\x2dsid. > -- Subject: Unit systemd-nspawn@debian\x2dsid.service has failed > -- Defined-By: systemd > -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel > -- -- Unit systemd-nspawn@debian\x2dsid.service has failed. > -- -- The result is failed. How can I start the container with > machinectl? It worked with previous systemd versions :) Tested with > systemd 230 on Arch Linux. Thanks again + regards, Stefan Hi, I did further testing on the case mentioned above: machinectl enable debian-sid and systemctl start systemd-nspawn@debian-sid starts the container (btw: that wasn't working in version 228). But when using: machinectl start debian-sid the "Invalid machine" error message still appears. The systemd-escape tool won't help in this case, as machinectl start `systemd-escape debian-sid` leads to an "Invalid machine name debian\x2dsid." message. Can someone confirm this behaviour? Thanks again + regards, Stefan ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Failed to start Container: minus sign is replaced to slash in container name
Am 12.01.2016 um 21:43 schrieb Lennart Poettering: > On Tue, 12.01.16 21:23, Stefan Schweter (ste...@schweter.it) wrote: > >> Dear systemd-users, >> >> e.g. when a container name includes a minus sign like: >> >> ls -l /var/lib/machines >> insgesamt 4 >> drwxr-xr-x 22 root root 4096 12. Jan 21:14 host.cis.uni-muenchen.de >> >> Enabling the systemd-nspawn service with: >> >> systemctl enable systemd-nsp...@host.cis.uni-muenchen.de >> Created symlink from >> /etc/systemd/system/machines.target.wants/systemd-nsp...@host.cis.uni-muenchen.de.service >> to /usr/lib/systemd/system/systemd-nspawn@.service. > > Yeah, the way systemd encodes slashes in unit names is by converting > them to dots. Thus when you actually want a dash you need to escape > it. The tool systemd-escape can help you with getting this right from > shell scripts. See the last example in the systemd-escape(1) man page > For details. > > But, given that this is a bit nasty to use, you can alternatively just > use "machinectl start ..." and "machinectl enable ..." which will do > the escaping for you, prefix the systemd-nspawn@ thing and the suffix > the .service thing, and is otherwise equvialent to systemctl start and > systemctl enable. > > Lennart > Hi Lennart and all other systemd users, I tried to enable + start a container named debian-sid. E.g. the following command works without any problems: systemd-nspawn -M debian-sid Then I used the machinectl tool for enabling the container: [root@build ~]# machinectl enable debian-sid Created symlink /etc/systemd/system/machines.target.wants/systemd-nspawn@debian\x2dsid.service → /usr/lib/systemd/system/systemd-nspawn@.service. When starting the container: [root@build ~]# machinectl start debian-sid Job for systemd-nspawn@debian\x2dsid.service failed because the control process exited with error code. See "systemctl status "systemd-nspawn@debian\\x2dsid.service"" and "journalctl -xe" for details. The output of the journalctl is: Jun 02 01:21:40 build.name.eu systemd-nspawn[6477]: Invalid machine name: debian\x2dsid Jun 02 01:21:40 build.name.eu systemd[1]: systemd-nspawn@debian\x2dsid.service: Main process exited, cod Jun 02 01:21:40 build.name.eu systemd[1]: Failed to start Container debian\x2dsid. -- Subject: Unit systemd-nspawn@debian\x2dsid.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit systemd-nspawn@debian\x2dsid.service has failed. -- -- The result is failed. How can I start the container with machinectl? It worked with previous systemd versions :) Tested with systemd 230 on Arch Linux. Thanks again + regards, Stefan ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] MYSQL SERVICE FAILED
Am 30.04.2016 um 20:32 schrieb Alessandro Cellini: > *** > Comand History and Logs > *** > Hi Alessandro, try to report or find an existing bug report here [1] and make sure that you've read the reporting guideline [2]. Another interesting bug report for your "MySQL system database not found" problem could be [3], even when you're not using the Jujucharms. Greetings, Stefan [1] https://bugs.launchpad.net/ubuntu/+source/mysql-5.7 [2] https://wiki.kubuntu.org/Kubuntu/Bugs/Reporting [3] https://bugs.launchpad.net/charms/+source/mysql/+bug/1567778 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Failed to start Container: minus sign is replaced to slash in container name
Am 12.01.2016 um 21:43 schrieb Lennart Poettering: > On Tue, 12.01.16 21:23, Stefan Schweter (ste...@schweter.it) wrote: > >> Dear systemd-users, >> >> e.g. when a container name includes a minus sign like: >> >> ls -l /var/lib/machines >> insgesamt 4 >> drwxr-xr-x 22 root root 4096 12. Jan 21:14 host.cis.uni-muenchen.de >> >> Enabling the systemd-nspawn service with: >> >> systemctl enable systemd-nsp...@host.cis.uni-muenchen.de >> Created symlink from >> /etc/systemd/system/machines.target.wants/systemd-nsp...@host.cis.uni-muenchen.de.service >> to /usr/lib/systemd/system/systemd-nspawn@.service. > > Yeah, the way systemd encodes slashes in unit names is by converting > them to dots. Thus when you actually want a dash you need to escape > it. The tool systemd-escape can help you with getting this right from > shell scripts. See the last example in the systemd-escape(1) man page > For details. > Hi Lennart, thanks for your explanation. I tried registering the container with the machinectl command and enabling + starting the container works without any problems! Thanks again + regards, Stefan ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] Failed to start Container: minus sign is replaced to slash in container name
Dear systemd-users, e.g. when a container name includes a minus sign like: ls -l /var/lib/machines insgesamt 4 drwxr-xr-x 22 root root 4096 12. Jan 21:14 host.cis.uni-muenchen.de Enabling the systemd-nspawn service with: systemctl enable systemd-nsp...@host.cis.uni-muenchen.de Created symlink from /etc/systemd/system/machines.target.wants/systemd-nsp...@host.cis.uni-muenchen.de.service to /usr/lib/systemd/system/systemd-nspawn@.service. works fine, but when starting the service with: systemctl start systemd-nsp...@host.cis.uni-muenchen.de Job for systemd-nsp...@host.cis.uni-muenchen.de.service failed because the control process exited with error code. See "systemctl status systemd-nsp...@host.cis.uni-muenchen.de.service" and "journalctl -xe" for details. an error occurs - the status -l command: Jan 12 21:15:22 arch-64-platon systemd[1]: Starting Container host.cis.uni/muenchen.de... Jan 12 21:15:22 arch-64-platon systemd-nspawn[1086]: Invalid machine name: host.cis.uni/muenchen.de Jan 12 21:15:22 arch-64-platon systemd[1]: systemd-nsp...@host.cis.uni-muenchen.de.service: Main process exited, code=exited, status=1/FAILURE Jan 12 21:15:22 arch-64-platon systemd[1]: Failed to start Container host.cis.uni/muenchen.de. Why is the machine name invalid and the minus sign replaced with a slash? /usr/bin/systemd-nspawn --quiet --boot --link-journal=try-guest --network-veth --settings=override --machine=host.cis.uni-muenchen.de starts my machine without any problems. Thanks many in advance + regards, Stefan Btw: I'm using version 228 from the Arch Linux repository, my locale is set to de_DE.UTF-8. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel