Search code examples
linuxservicesystemd

systemd service that starts before user interaction, possible?


It is possible to make a systemd service that will start before console output "login as, password" etc?

Target is to prevent user input before service starts.


Solution

  • Resolved with service:

    [Unit]
    Description=Blabla
    After=docker.service
    [email protected]
    ConditionPathExists=!/etc/something
    ConditionPathExists=/etc/something2
    
    [Service]
    Type=oneshot
    ExecStart=/usr/local/bin/test
    StandardOutput=tty
    StandardError=tty
    
    [Install]
    WantedBy=getty.target