Re: [systemd-devel] Questions about initrd environment services and IgnoreOnIsolate

2024-05-13 Thread killermoehre
Hi,

may I ask why you need your own .service to load the module instead of using 
modules-load.d and modprobe.d? Just to understand your problem better.

BR
Silvio


Re: [systemd-devel] rc-local.service and its future in systemd?

2023-04-24 Thread killermoehre
Am 24.04.2023 um 12:52 schrieb Aki Ketolainen :
>> This totally depends on the unit you wrote. Without it, we can't help. In 
>> general, ignore and forget the run level concept.
>> BR
>> Silvio
> 
> I only changed these settings in rc-local.service:
> 
> [Unit]
> After=systemd-update-utmp-runlevel.service
> 
> [Install]
> WantedBy=default.target
> 
> and disabled /usr/lib/systemd/system-generators/systemd-rc-local-generator 
> from running.
> When I tried to boot, the system didn't come up any more.

Well, you created a circular dependency. Just don't use the rc-local.service at 
all, but put the commands from there in their own .service units. Think about 
their dependencies and order Proper with Wants=, Before= and After=.

If you're able to share your rc.local script, than we can help.

Re: [systemd-devel] rc-local.service and its future in systemd?

2023-04-24 Thread killermoehre



> Am 24.04.2023 um 12:20 schrieb Aki Ketolainen :
> 
>> as Lennard already told you in the GitHub issue that "last" just doesn't 
>> make sense in systemd, there is also no need to change the dependencies
>> global for everyone. Especially as there are systems out there which doesn't 
>> have crond installed (because there are .timer).
>> Your best bet is really to change all your custom scripts from rc.local into 
>> proper .service and instead of crond check out systemd.timer.
>> BR
>> Silvio
> 
> I tried to set After=systemd-update-utmp-runlevel.service but I got some 
> cyclic dependency problem. Would you know how to do that?
> 
> Best regards,
> 
> Aki
This totally depends on the unit you wrote. Without it, we can't help. In 
general, ignore and forget the run level concept.

BR
Silvio

Re: [systemd-devel] rc-local.service and its future in systemd?

2023-04-24 Thread killermoehre
> Am 24.04.2023 um 10:57 schrieb Aki Ketolainen :
> 
> Hi,
> I noticed in Rocky Linux 8.7 LXC container image that they've added a message 
> to /etc/rc.d/rc.local:
> # In contrast to previous versions due to parallel execution during boot
> # this script will NOT be run after all other services.
> I created an issue report on this at github: 
> https://github.com/systemd/systemd/issues/27340
> "How to run /etc/rc.d/rc.local as the last Linux bootup task?"
> Would it be possible to change the rc-local.service configuration as follows, 
> so that it could be used similarly as before
> i.e. running close to the end of the "runlevel" or systemd target:
> [Unit]
> After=crond.service
> [Install]
> WantedBy=default.target
> chmod 700 /etc/rc.d/rc.local
> systemctl enable rc-local.service
> I tested this and see in ps output (ps auxwwf | sort -n -k 2,2 >> 
> /var/tmp/boot.ps) that it starts after crond
> in both multi-user.target and graphical.target.
> Best regards,
> Aki

Hi Aki,

as Lennard already told you in the GitHub issue that "last" just doesn't make 
sense in systemd, there is also no need to change the dependencies global for 
everyone. Especially as there are systems out there which doesn't have crond 
installed (because there are .timer).

Your best bet is really to change all your custom scripts from rc.local into 
proper .service and instead of crond check out systemd.timer.

BR
Silvio

Re: [systemd-devel] Some questions on userdbd and providing a compatible service

2022-11-24 Thread killermoehre
> Am 24.11.2022 um 00:58 schrieb Dominik George :
> 
> Hi,
> 
> for some time now, I have been investigating how to best make a
> desktop system talk to a web API (HTTP, REST) for user management, so
> NSS and PAM make HTTP requests to an API to verify authentication
> (using OIDC) and to retrieve NIS information (using REST endpoints).
> 
> One of the approaches I am evaluating involves systemd-userdbd,
> because it seems to be designed with extensibility with modular
> service implementations in mind.
> 
> Right now, I have a few questions concerning its architecture and use:
> 
> * Why was Varlink chosen over D-Bus, given that most other parts of
>   systemd seem to talk D-Bus?
> 
> * How does protection of privileged fields work? In a different
>   approach (using my own gRPC-based protocol), I used peer
>   credentials on the UNIX socket for authorisation, but it seems this
>   should break with userdbd when going through the
>   multipelxer. However, I see "Warning: lacking rights to acquire
>   privileged fields of user record of 'testnik', output incomplete."
>   when I try to inspect another user as an unprivileged user. How
>   does userdbd determine that?
> 
> * userdbd only helps for user information, i.e. for providing data to
>   NSS through a decoupled interface. I would need to do the same for
>   PAM, but intil now, I could not find an existing standard for
>   verifying credentials. Was that just not done yet, or is there a
>   design decision that userdbd should not offer methods for
>   authentication? I see that systemd-homed implements its own API
>   through D-Bus…
> 
> * Ultimately, I would like to retrieve and store an OAuth token on
>   user login. It would somehow be a good fit for the "secret" section
>   of the User Record, but the fields allowed in it seem to be
>   static. Are there any ideas around here where such a token could be
>   stored during the user session?
> 
> Thanks for your help,
> Nik

Hi Nik,

IMHO your best solution would be to use https://sssd.io/ and 
https://www.keycloak.org/ to bundle your systems together.

Keycloak would speak to your OIDC provider and translates the information in 
something sssd can understand. sssd than is put into your nsswitch.conf as 
provider for users, groups, etc.

HTH
Silvio

Re: [systemd-devel] Disabling cpufreq/boost at boot time sometimes fails

2022-07-13 Thread killermoehre
> This must explain why my modprobe.d (of acpi_cpufreq) seems to always work 
> but not why tmpfiles.d or a .service unit :

Actually, your modprobe.d is much too late, if I understand correctly. The used 
power manager module/options are set during the kernel start and can’t be 
changed later. Only the governor used by the module could be changed, not the 
module itself.

> As a matter of fact, I assume that since the /sys files seem to be created 
> "at initialisation" or more precisely for the boost file, at driver, is 
> exposed by the kernel module, this should be done long before 
> systemd-tmpfiles-setup.service or my custom service are run ?

The actual structure _exposed_ via sysfs is created during kernel start and 
module load. /sys only allows you simple access to it. With systemd, /sys is 
considered an API filesystem, so it’s always mounted and available (AFAIK it’s 
so early that’s done by PID1 itself before starting anything else). But on 
systems without you don’t necessary have a /sys mount point. The structure 
would still be in the kernel, though.

> The only reason I can think of for those 2 latter setup to fail is that 
> driver has not been loaded yet, hence the 
> /sys/devices/system/cpu/cpufreq/boost file not existing yet, but I find this 
> weird.


The driver absolutely loaded, as stated earlier. What I find interesting is the 
error message you get with
> /sys/devices/system/cpu/cpufreq/boost: Permission denied

Did it failed because the file didn’t exists? Maybe the path you used is wrong?

>> Question I have is: why do you want to disable boosting?
> 
> One reason is because of rack density/input pdu power ratio.
> Another might be performance consistency (at least for benching)

In this case I think your best bet is to disable the most option in the 
BIOS/UEFI. At least 
https://docs.kernel.org/admin-guide/pm/cpufreq.html#rationale-for-boost-control-knob
 is speaking of that.
If you don’t have such option in the BIOS/UEFI settings, you could try some 
udev rule reacting to the /sys entry. Something like

`/etc/udev/rules.d/20-disable-cpu-boost.rules`
```
KERNEL=="cpu", ATTR{cpufreq/boost}=="1", ATTR{cpufreq/boost}:="0"
```

Totally untested, btw.

BR
Silvio

Re: [systemd-devel] Can a systemd --user instance rely on After= of systemd --system instance?

2017-02-25 Thread killermoehre
Am 25.02.2017 um 18:34 schrieb Patrick Schleizer:
> Hi,
>
> I read, that a systemd --user instance cannot use Requires=.
>
> But what about After=? Can a systemd --user instance use
> After=some-system.service?
>
> Cheers,
> Patrick
Hi Patrick,

no, --user instances know nothing about the --system instance and vice versa.
But internally, --user instances are full featured so you can have any 
dependency among your user units.

BR
Silvio



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to mount NFS prior to start postgresql from this volume

2016-07-01 Thread killermoehre
Am 01.07.2016 um 17:29 schrieb killermoehre:
> Am 01.07.2016 um 16:44 schrieb wolfgang.wag...@riwa-gis.de:
>> Hello list,
>>
>>  
>>
>> after days of reading man-pages and searching the web i have no solution
>> to my problem, and I am lost in the documentation.
>>
>> My system is Debian Jessie 8.5, upgraded from wheezy 7.11. With Debian
>> wheezy all works fine, after the upgrade to jessie my postgresql-service
>> does not start on boot automatically.
>>
>> Starting manually after booting works fine, but this is not a option for
>> a database-server.
>>
>> I want do some simple thing, which worked with SysV-Init without any
>> problems:
>>
>>  
>>
>> Starting postgresql from a NFS-mount.
>>
>>  
>>
>> I am not able to achieve this. The error is always the same:
>>
>>  
>>
>> Jul 01 16:11:27 postgis1 postgresql@9.4-main[536]: Error:
>> /mnt/daten/postgis/9.4/main is not accessible or does not exist
>>
>> Jul 01 16:11:27 postgis1 systemd[1]: postgresql@9.4-main.service:
>> control process exited, code=exited status=1
>>
>> Jul 01 16:11:27 postgis1 systemd[1]: Failed to start PostgreSQL Cluster
>> 9.4-main.
>>
>> Jul 01 16:11:27 postgis1 systemd[1]: Unit postgresql@9.4-main.service
>> entered failed state.
>>
>>  
>>
>> A few lines after these log-lines i  find this:
>>
>>  
>>
>> Jul 01 16:11:28 postgis1 rpcbind[818]: Starting rpcbind daemon
>>
>> Jul 01 16:11:28 postgis1 rpc.statd[861]: Version 1.2.8 starting
>>
>> Jul 01 16:11:28 postgis1 rpc.statd[861]: Flags: TI-RPC
>>
>> Jul 01 16:11:28 postgis1 kernel: FS-Cache: Loaded
>>
>> Jul 01 16:11:28 postgis1 kernel: RPC: Registered named UNIX socket
>> transport module.
>>
>> Jul 01 16:11:28 postgis1 kernel: RPC: Registered udp transport module.
>>
>> Jul 01 16:11:28 postgis1 kernel: RPC: Registered tcp transport module.
>>
>> Jul 01 16:11:28 postgis1 kernel: RPC: Registered tcp NFSv4.1 backchannel
>> transport module.
>>
>> Jul 01 16:11:28 postgis1 kernel: FS-Cache: Netfs 'nfs' registered for
>> caching
>>
>>  
>>
>> It seems to me, that NFS-mounts were done after trying to start postgresql.
>>
>>  
>>
>> My postgresql.service is this:  (unmodified file)
>>
>> [Unit]
>>
>> Description=PostgreSQL RDBMS
>>
>>  
>>
>> [Service]
>>
>> Type=oneshot
>>
>> ExecStart=/bin/true
>>
>> ExecReload=/bin/true
>>
>> RemainAfterExit=on
>>
>>  
>>
>> [Install]
>>
>> WantedBy=multi-user.target
>>
>> ---
>>
>> Modifications in section [Unit] like :
>>
>> ConditionPathExists=/mnt/daten/postgis
>>
>>  
>>
>> Requires=mnt-daten-postgis.mount
>>
>> Before=mnt-daten-postgis.mount
>>
>> (and creating a Unit-file for the mount-point, enabling etc. instead of
>> /etc/fstab) don’t change the problem.
>>
>>  
>>
>> After booting is complete, the mount is available, but not at the time,
>> when postgresql should  be startet.
>>
>>  
>>
>> Maybe it is caused by this  (ssome lines before in journalctl-log):
>>
>> Jul 01 16:09:57 postgis1 systemd[1]: Cannot add dependency job for unit
>> display-manager.service, ignoring: Unit display-manager.service f
>>
>> Jul 01 16:09:57 postgis1 systemd[1]: Found ordering cycle on
>> basic.target/start
>>
>> Jul 01 16:09:57 postgis1 systemd[1]: Found dependency on
>> sysinit.target/start
>>
>> Jul 01 16:09:57 postgis1 systemd[1]: Found dependency on
>> rpcbind.service/start
>>
>> Jul 01 16:09:57 postgis1 systemd[1]: Found dependency on
>> network-online.target/start
>>
>> Jul 01 16:09:57 postgis1 systemd[1]: Found dependency on
>> vmware-tools.service/start
>>
>> Jul 01 16:09:57 postgis1 systemd[1]: Found dependency on basic.target/start
>>
>> Jul 01 16:09:57 postgis1 systemd[1]: Breaking ordering cycle by deleting
>> job rpcbind.service/start
>>
>> Jul 01 16:09:57 postgis1 systemd[1]: Job rpcbind.service/start deleted
>> to break ordering cycle starting with basic.target/start
>>
>>  
>>
>>  
>>
>> Where is my error?
>>
>>  
>>
>>  
>>
>> mit freundlichen Grüssen
>>
>>  
>>
>> Wolfgang Wagner
>>
>> Systemadministration
>>

Re: [systemd-devel] How to mount NFS prior to start postgresql from this volume

2016-07-01 Thread killermoehre
Am 01.07.2016 um 16:44 schrieb wolfgang.wag...@riwa-gis.de:
> Hello list,
> 
>  
> 
> after days of reading man-pages and searching the web i have no solution
> to my problem, and I am lost in the documentation.
> 
> My system is Debian Jessie 8.5, upgraded from wheezy 7.11. With Debian
> wheezy all works fine, after the upgrade to jessie my postgresql-service
> does not start on boot automatically.
> 
> Starting manually after booting works fine, but this is not a option for
> a database-server.
> 
> I want do some simple thing, which worked with SysV-Init without any
> problems:
> 
>  
> 
> Starting postgresql from a NFS-mount.
> 
>  
> 
> I am not able to achieve this. The error is always the same:
> 
>  
> 
> Jul 01 16:11:27 postgis1 postgresql@9.4-main[536]: Error:
> /mnt/daten/postgis/9.4/main is not accessible or does not exist
> 
> Jul 01 16:11:27 postgis1 systemd[1]: postgresql@9.4-main.service:
> control process exited, code=exited status=1
> 
> Jul 01 16:11:27 postgis1 systemd[1]: Failed to start PostgreSQL Cluster
> 9.4-main.
> 
> Jul 01 16:11:27 postgis1 systemd[1]: Unit postgresql@9.4-main.service
> entered failed state.
> 
>  
> 
> A few lines after these log-lines i  find this:
> 
>  
> 
> Jul 01 16:11:28 postgis1 rpcbind[818]: Starting rpcbind daemon
> 
> Jul 01 16:11:28 postgis1 rpc.statd[861]: Version 1.2.8 starting
> 
> Jul 01 16:11:28 postgis1 rpc.statd[861]: Flags: TI-RPC
> 
> Jul 01 16:11:28 postgis1 kernel: FS-Cache: Loaded
> 
> Jul 01 16:11:28 postgis1 kernel: RPC: Registered named UNIX socket
> transport module.
> 
> Jul 01 16:11:28 postgis1 kernel: RPC: Registered udp transport module.
> 
> Jul 01 16:11:28 postgis1 kernel: RPC: Registered tcp transport module.
> 
> Jul 01 16:11:28 postgis1 kernel: RPC: Registered tcp NFSv4.1 backchannel
> transport module.
> 
> Jul 01 16:11:28 postgis1 kernel: FS-Cache: Netfs 'nfs' registered for
> caching
> 
>  
> 
> It seems to me, that NFS-mounts were done after trying to start postgresql.
> 
>  
> 
> My postgresql.service is this:  (unmodified file)
> 
> [Unit]
> 
> Description=PostgreSQL RDBMS
> 
>  
> 
> [Service]
> 
> Type=oneshot
> 
> ExecStart=/bin/true
> 
> ExecReload=/bin/true
> 
> RemainAfterExit=on
> 
>  
> 
> [Install]
> 
> WantedBy=multi-user.target
> 
> ---
> 
> Modifications in section [Unit] like :
> 
> ConditionPathExists=/mnt/daten/postgis
> 
>  
> 
> Requires=mnt-daten-postgis.mount
> 
> Before=mnt-daten-postgis.mount
> 
> (and creating a Unit-file for the mount-point, enabling etc. instead of
> /etc/fstab) don’t change the problem.
> 
>  
> 
> After booting is complete, the mount is available, but not at the time,
> when postgresql should  be startet.
> 
>  
> 
> Maybe it is caused by this  (ssome lines before in journalctl-log):
> 
> Jul 01 16:09:57 postgis1 systemd[1]: Cannot add dependency job for unit
> display-manager.service, ignoring: Unit display-manager.service f
> 
> Jul 01 16:09:57 postgis1 systemd[1]: Found ordering cycle on
> basic.target/start
> 
> Jul 01 16:09:57 postgis1 systemd[1]: Found dependency on
> sysinit.target/start
> 
> Jul 01 16:09:57 postgis1 systemd[1]: Found dependency on
> rpcbind.service/start
> 
> Jul 01 16:09:57 postgis1 systemd[1]: Found dependency on
> network-online.target/start
> 
> Jul 01 16:09:57 postgis1 systemd[1]: Found dependency on
> vmware-tools.service/start
> 
> Jul 01 16:09:57 postgis1 systemd[1]: Found dependency on basic.target/start
> 
> Jul 01 16:09:57 postgis1 systemd[1]: Breaking ordering cycle by deleting
> job rpcbind.service/start
> 
> Jul 01 16:09:57 postgis1 systemd[1]: Job rpcbind.service/start deleted
> to break ordering cycle starting with basic.target/start
> 
>  
> 
>  
> 
> Where is my error?
> 
>  
> 
>  
> 
> mit freundlichen Grüssen
> 
>  
> 
> Wolfgang Wagner
> 
> Systemadministration
> 
>  
> 
> RIWA GmbH
> 
> Gesellschaft für Geoinformationen
> 
> Zwingerstr. 2, 87435 Kempten
> 
> E-Mail: wolfgang.wag...@riwa-gis.de
> 
> http://www.riwa-gis.de
> 
>  
> 
> --
> RIWA GmbH, Zwingerstrasse 2, 87435 Kempten
> Sitz der Gesellschaft: Kempten (Allgaeu)
> Registergericht: Amtsgericht Kempten, HRB 6480
> Geschaeftsfuehrer: Dipl.-Ing. Guenter Kraus
> --
> 
> 
> 
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
> 

Hi,

just drop a
---
[Unit]
ReuqiresMountsFor=/mnt/daten/postgis/9.4/main
---
into
»/etc/systemd/system/postgresql@9.4-main.service.d/wait-for-mountpoint.conf«
(create directory and file if necessary) end everything should be fine.
In your fstab also add »_netfs« and remove »noauto« for your mount
point. See »man systemd.unit« for more informations on RequireMountsFor=.

Regards




signature.asc
Description: OpenPGP digital 

Re: [systemd-devel] Automount some dirs at user ligin

2016-05-18 Thread killermoehre
Am 18.05.2016 um 21:14 schrieb Vasiliy Tolstov:
> I need to mount tmpfs on .cache for each user after login.
> How can I do that with systemd?
> S
> For example I want for user1 mount tmpfs on dir .cache, for user2 mount
> .cache to tmpfs also and so on.
> After logout last session for this user, I need to unmount it...
IMHO you should use pam_mount [1] for this instead.

[1] http://pam-mount.sourceforge.net/
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] mounting the root file system using systemd unit file

2016-05-15 Thread killermoehre
Am 15.05.2016 um 14:28 schrieb fb.dev.gen:
> Hi all,
> 
> What should be the way to mount the root file system using systemd unit
> file (i.e: without any `/etc/fstab` configuration file)?
> 
> Could it be right to do it like that:
> 
> ```
> # cat > /etc/systemd/system/root.mount << EOF
> [Unit]
> Description = Root file system mount point controlled and supervised by
> systemd
> 
> [Mount]
> What = /dev/root
> Where = /
> Type = ext4
> Options = default,discard,noatime 0 0
> 
> [Install]
> WantedBy = multi-user.target
> EOF
> 
> ```
> 
> ...or is there a better "systemd way" to do it?
> 
> 
> -- Ben

Hi Ben,

according to the systemd.mount man page, »In general, configuring mount
points through /etc/fstab is the preferred approach«. So /etc/fstab is
already the systemd way to do it.
Do you have any special reasons not to use /etc/fstab?

Regards
killermoehre




signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Monitor path to commit to git

2016-04-08 Thread killermoehre
Am 07.04.2016 um 20:11 schrieb Florian Lindner:
> Hello,
> I want to have a unit that monitors a path and commits automatically to
> git whenever something changes. It usually works, like that:
> 
> # cat git-commit@.service
> [Unit]
> Description=Automatic commit for %f
> 
> [Service]
> Type = oneshot
> Nice = 10
> 
> # git returns 1 if there is nothing to commit
> SuccessExitStatus=1
> 
> WorkingDirectory = %f
> ExecStart = /usr/bin/git add --all .
> ExecStart = /usr/bin/git commit -a -m "Automatic commit."
> 
> 
> # cat git-commit@.path 
> [Unit]
> Description = Path monitor for %f
> 
> [Path]
> PathChanged = %f
> 
> [Install]
> WantedBy = multi-user.target
> 
> It basically works but has two issues:
> 
> 1) The path unit does not seem to monitor the path recursively, therefore I 
> don't get a commit when a file in a subdirectory changes
> 
> 2)Sometimes the commit fails, like when an application pushes files to 
> quickly into the directory:
> 
> Failed to start Automatic commit for /etc.
> git-commit@etc.service: Start request repeated too quickly
> 
> or when files vanish before they are commited.
> 
> This is usally not a problem, and I just want to restart it (after a short 
> delay) Setting Restart=on-failure on a Type=oneshort unit does not work 
> git-commit@etc.service: 
> 
> Service has Restart= setting other than no, which isn't allowed for 
> Type=oneshot services. Refusing.
> 
> Any idea how to address these two issues?
> 
> Thanks!
> Florian

Hi Florian,

for this I normally use https://github.com/axkibe/lsyncd, which can do
this recursivly. In my use case I sign packages this way after building.

Regards
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Options for logging from service started before journald?

2015-10-18 Thread killermoehre
Am 18.10.2015 um 17:05 schrieb Andrei Borzenkov:
> What can be done to log from unit that needs to be started before
> journald? Journal, syslog or kmsg all require journald connection and as
> far as I understand will deadlock on waiting for journald to accept it.
> NULL is not an option; is tty the only choice left?
> 
> Background - openSUSE tries to start haveged before journald to add
> randomness.
> 
> This sounds like reincarnation of "how to log to syslog and be started
> before syslogd". This was solved by moving logging connection to
> journald and starting it very early. May be something like minilod or
> blogd that buffers output until journald is started would be appropriate
> here?

How about not putting haveged in the early part if it can't work
without? In Arch Linux, haveged is a part of multi-user.target.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] httpd.service daemon failing to start on Manjaro Linux

2015-08-18 Thread killermoehre
Am 18.08.2015 um 16:24 schrieb Brenton Horne:
 Hi,

 I've been following this guide
 https://wiki.archlinux.org/index.php/MediaWiki to install MediaWiki
 1.25.2 on my Manjaro Linux machine. I managed to follow the guide,
 without errors until I reached the stage of restarting httpd.service,
 namely running:

 systemctl restart httpd.service


 This gives the error:

 Job for httpd.service failed because the control process exited with
 error code. See systemctl status httpd.service and journalctl
 -xe for details.


 Running

 systemctl status httpd.service

 gives:

 ● httpd.service - Apache Web Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled;
 vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2015-08-18 23:18:10
 AEST; 16s ago
   Process: 1083 ExecStart=/usr/bin/apachectl start (code=exited,
 status=1/FAILURE)

 Aug 18 23:18:10 fusion809-vbox systemd[1]: Stopped Apache Web Server.
 Aug 18 23:18:10 fusion809-vbox systemd[1]: Starting Apache Web Server...
 Aug 18 23:18:10 fusion809-vbox apachectl[1083]: AH00526: Syntax
 error on lin...:
 Aug 18 23:18:10 fusion809-vbox apachectl[1083]: Invalid command
 'php_admin_v...n
 Aug 18 23:18:10 fusion809-vbox systemd[1]: httpd.service: Control
 process ex...1
 Aug 18 23:18:10 fusion809-vbox systemd[1]: Failed to start Apache
 Web Server.
 Aug 18 23:18:10 fusion809-vbox systemd[1]: httpd.service: Unit
 entered faile
 Aug 18 23:18:10 fusion809-vbox systemd[1]: httpd.service: Failed
 with result
 Hint: Some lines were ellipsized, use -l to show in full.


 Likewise running:

 journalctl -xe

 gives:

 Aug 18 23:18:10 fusion809-vbox systemd[1]: Starting Apache Web Server...
 -- Subject: Unit httpd.service has begun start-up
 -- Defined-By: systemd
 -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
 --
 -- Unit httpd.service has begun starting up.
 Aug 18 23:18:10 fusion809-vbox apachectl[1083]: AH00526: Syntax
 error on line 2
 Aug 18 23:18:10 fusion809-vbox apachectl[1083]: Invalid command
 'php_admin_valu
 Aug 18 23:18:10 fusion809-vbox systemd[1]: httpd.service: Control
 process exite
 Aug 18 23:18:10 fusion809-vbox systemd[1]: Failed to start Apache
 Web Server.
 -- Subject: Unit httpd.service has failed
 -- Defined-By: systemd
 -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
 --
 -- Unit httpd.service has failed.
 --
 -- The result is failed.
 Aug 18 23:18:10 fusion809-vbox systemd[1]: httpd.service: Unit
 entered failed s
 Aug 18 23:18:10 fusion809-vbox systemd[1]: httpd.service: Failed
 with result 'e
 Aug 18 23:18:10 fusion809-vbox polkitd[384]: Unregistered
 Authentication Agent
 Aug 18 23:18:21 fusion809-vbox pulseaudio[666]: [alsa-sink-Intel
 ICH] alsa-sink
 Aug 18 23:18:21 fusion809-vbox pulseaudio[666]: [alsa-sink-Intel
 ICH] alsa-sink
 Aug 18 23:18:21 fusion809-vbox pulseaudio[666]: [alsa-sink-Intel
 ICH] alsa-sink
 lines 2281-2303/2


 Any help with be greatly appreciated.

 Thanks for your time,
 Brenton


 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel

As you can see in the output of systemctl status, your apache.conf has an 
syntax error. Fix it.

Regards
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Method to Wait for service to complete

2015-08-12 Thread killermoehre
Am 12.08.2015 um 20:34 schrieb Harry Goldschmitt:
 I have a service that has to complete before boot can continue. Is there
 an “approved” method for doing this?
 
  
 
 I have an ugly solution I’ve come up with… I’ve created a foo.target to
 run my foo.service and set the default.target to my foo.target. After my
 foo.service completes, I’m issuing “systemctl isolate multi-user” to
 complete the boot.
 
  
 
 Any help would be appreciated.
 
  
 
 Harry

Because my first answer wasn't send to the ML, here again:

 Hello Harry,

 so the first question here always is: why do you think your service
 is so important that no other service should be run at the same time?
 Can you give us more information about your service? Some
 explanaition what it does and why it should run before boot completes
 (which is quite the funny thing, because boot end is never defined
 with systemd, because everyting is brought up in parallel only taking
 dependencies in account).

 Regards

Harrys answer

 My product is a Linux network appliance and my service updates
 platform and peripheral firmware as needed without human
 intervention. For the updates to take effect, the platform needs to
 be rebooted after updates. If a network card needs new firmware, the
 network is shut down before the update. If a peripheral needs to be
 updated, it is shutdown, too. It would probably be a bad idea to let
 users log into the appliance only to shutdown peripherals and then
 reboot after a firmware update. In addition we have several services
 that should not be brought up before it is known that firmware needs
 to be updated.

 Before systemd, we just ran the service early in the boot process.
 99.9% of the time the service did nothing and boot continued. If
 something had to be updated, the service did the update and rebooted.

In the end after I got his answer it boils down to
http://www.freedesktop.org/wiki/Software/systemd/SystemUpdates/

Regards
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to get used to systemd vs init

2015-06-23 Thread killermoehre
Am 24.06.2015 um 02:00 schrieb Chad:
 On 6/23/2015 4:45 PM, Ronny Chevalier wrote:
  On Wed, Jun 24, 2015 at 1:37 AM, Chad ccolu...@gmail.com wrote:
  Oh, wait this is the reverse of what I want/need (systemd-sysv-generator
  goes from init.d to systemd, I need from systemd to init.d).
  I have a nagios script that runs something like:
  /etc/init.d/httpd status
  It then reads the output and makes sure httpd is running, if not it
  takes
  action depending on the service.
  I use that method for tons of services.
  I don't want to have to re-write the modules to use:
  systemctl status httpd
  If I did that then I will not be able to rsync the scripts/configs
  around
  and would have to maintain 2 versions of the code.
  I was wondering if there was an easy way to create a /etc/init.d/httpd
  script that called something like this inside:
  #!/bin/bash
  systemctl $1 $0
  I know it is not that simple ($0 for example is the full path
  /etc/init.d/httpd not just the httpd), which is why I am hoping there
  is a
  tool for this.
 
  If you just want to know if a service is active you can use:
 
  systemctl is-active httpd
 
  If $? equals 0 then the service is active, else it is not :)
 
  If you make your script use this I don't see why you would have to
  maintain multiple versions, if your intention is to use systemd
  everywhere.
 Except that I can not convert all servers I maintain over just like
 that, it will take time, probably 1-2 years.

 As to: systemctl is-active httpd, that would work sometimes but not
 others. For example I check fail2ban by running /etc/init.d/iptables
 status which outputs all the firewall rules then check that output to
 make sure the chains for fail2ban are there. If you restart iptables
 without restarting fail2ban, fail2ban will show as running because the
 daemon is up, but since the chains are gone it can not ban bad guys.

 Maybe one of you knows a solution to that (iptables restart without a
 fail2ban restart), I have not found one for init.d, is this fixed
 somehow in systemd?
 That would be another advantage.

 ^C

 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Hi Chad,

why don't make a dependency between iptables and fail2ban? This is really easy 
in systemd with Requires and Wants entries in the services. So you can't 
restart iptables without automatic trigger of a fail2ban restart.

Regards
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] automatic name resolution of nspawn-machines

2015-03-03 Thread killermoehre
Hi,

I'm running systemd-219 on arch linux. The setup is as follows:
- Host (laptop in changing networks) with multiple NICs
- unbound as caching DNS proxy on the host listening on any interface
- NetworkManager for wireless control
- several nspawn-machines using the default systemd-nspawn.service which
configure their net by itself (/28) via systemd-networkd.

In the nspawn-container I added a perl-one-liner as service to set the
default gateway as DNS-server, where unbound is listening (which would
be a nice default feature for networkd, too):

--- /etc/systemd/system/set-gateway-as-dns.service (line broken) ---
[Unit]
Description=Set the default gateway as DNS server
Requires=network-online.target
After=network-online.target

[Service]
Type=oneshot
ExecStart=-/usr/bin/mkdir -p /run/systemd/resolved.conf.d
ExecStart=/usr/bin/perl -e 'open(my $fh, ,
/run/systemd/resolved.conf.d/99-gateway.conf);
print { $fh } [Resolve]\nDNS= . join(, qx(/usr/bin/networkctl
--no-pager --no-legend status host0) =~ /Gateway:
(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/) . \n;
close($fh);'
ExecStart=/usr/bin/systemctl restart systemd-resolved

[Install]
WantedBy=multi-user.target
--- End Of File ---

My goal now: I want that the host can talk to the machines and vice
versa via simple hostnames, so if my nspawn-machine is called web and
the machines hostname is web, too, than http://web/ should talk to the
webserver in this machine. web.local via mdns would be fine, too.

Any advice?

Regards
Silvio Knizek
-- 
Xfce4.12 is out! Wait until your distributor packaged it for you!
Questions regarding xfce? Meet me at irc://irc.freenode.net/xfce



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Fwd: best way to handle service restarts after hibernate/suspend?

2013-08-08 Thread killermoehre
Am 08.08.2013 08:12, schrieb 孙冰:
 I use this:
 
 [Unit]
 Description=Wicd sleep hook
 Before=sleep.target
 StopWhenUnneeded=yes
 
 [Service]
 Type=oneshot
 RemainAfterExit=yes
 ExecStart=-/usr/share/wicd/daemon/suspend.py
 ExecStop=-/usr/share/wicd/daemon/autoconnect.py
 
 [Install]
 WantedBy=sleep.target
 -

Thank you very much for this idea. I think it can be expressed in a more
generic way:


[Unit]
Description=%I sleep hook
Before=sleep.target
StopWhenUnneeded=yes

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=-/usr/bin/systemctl stop %I
ExecStop=-/usr/bin/systemctl start %I

[Install]
WantedBy=sleep.target
-

It would be invoked from sleep-hook@.service.
What do you think?



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Feature wish - auto-complete

2013-06-18 Thread killermoehre
Am 18.06.2013 15:44, schrieb David Lambert:
 As I am lazy I would love to see the auto-complete feature implemented
 in systemd CLI.
 
 Dave.
 

Hi Dave,

Well, I have autocompletion for systemctl, journalctl, loginctl, *ctl,
etc. Are you sure bash-completion is installed and enabled?

Regards




signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel