LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   SystemD services to be blocking "URGENT" (https://www.linuxquestions.org/questions/linux-server-73/systemd-services-to-be-blocking-urgent-4175639284/)

SriRamaSan 09-27-2018 07:13 AM

SystemD services to be blocking "URGENT"
 
Hi all,
I am performing a customized installation of CentOS, where instead of standard Anaconda, installation wizard, I am invoking my own wizard which will collect inputs for installation
My code is based on newt (https://pagure.io/newt) and uses python3.4

I am facing a challenge that before wizard could complete, it goes to subsequent service in my case getty@tty1.service, getty.target, multi-user.target
so I get the login prompt test login:

How do I ensure, this prompt/ or my wizard completes before login prompt comes

I am putting my systemd service file contents below

# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.

# See systemd.special(7) for details

[Unit]
Description=Start Wizard as a service
DefaultDependencies=no
After=sshd.service
ConditionPathExists=/opt/install/
Before=getty@tty1.service getty@tty2.service getty@rrt3.service getty@tty4.service getty@tty5.service getty@tty6.service

[Service]
Environment=TERM=vt220
Type=oneshot
ExecStart=/opt/install/bin/menu.sh
StandardInput=tty-force
StandardOutput=console
StandardError=syslog+console
RemainAfterExit=yes
TimeoutSec=0

[install]
# Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
# terminates cleanly.
WantedBy=multi-user.target

TB0ne 09-27-2018 11:28 AM

Quote:

Originally Posted by SriRamaSan (Post 5908420)
Hi all,
I am performing a customized installation of CentOS, where instead of standard Anaconda, installation wizard, I am invoking my own wizard which will collect inputs for installation My code is based on newt (https://pagure.io/newt) and uses python3.4

I am facing a challenge that before wizard could complete, it goes to subsequent service in my case getty@tty1.service, getty.target, multi-user.target
so I get the login prompt test login: How do I ensure, this prompt/ or my wizard completes before login prompt comes I am putting my systemd service file contents below
Code:

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

# See systemd.special(7) for details

[Unit]
Description=Start Wizard as a service
DefaultDependencies=no
After=sshd.service
ConditionPathExists=/opt/install/
Before=getty@tty1.service getty@tty2.service getty@rrt3.service getty@tty4.service getty@tty5.service getty@tty6.service

[Service]
Environment=TERM=vt220
Type=oneshot
ExecStart=/opt/install/bin/menu.sh
StandardInput=tty-force
StandardOutput=console
StandardError=syslog+console
RemainAfterExit=yes
TimeoutSec=0

[install]
# Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
# terminates cleanly.
WantedBy=multi-user.target


Use CODE tags when posting scripts and other things of this nature, please. And see the "How to ask a smart question" link in my posting signature. This is **NOT URGENT** for anyone here. We volunteer our time, so asking for/expecting 'urgent' assistance is fairly rude.

And based on what you posted, we can't tell you anything. You don't say what version of CentOS, nor post the contents of that menu.sh file that's getting called. Chances are, there's a bug/problem in it.

SriRamaSan 09-28-2018 01:38 AM

CentOS version I am working is CentOS 7.4
Script invokes the wizard python program based on newt
python3 wizard.py -f config file


sorry for adding URGENT

Regards
Ramki

TB0ne 09-28-2018 06:45 AM

Quote:

Originally Posted by SriRamaSan (Post 5908733)
CentOS version I am working is CentOS 7.4
Script invokes the wizard python program based on newt python3 wizard.py -f config file

Right...so back to "It's probably the menu.sh file you're CALLING, but haven't shown"
Quote:

sorry for adding URGENT
Yeah.

SriRamaSan 10-13-2018 11:42 PM

default.target
 
Hi all My problem got resolved, I had to ensure /etc/systemd/system/default.target points to target file which points to my service


All times are GMT -5. The time now is 01:25 PM.