/etc/issue Вывод IP перед логином

progressor

New member
Сообщения
2
#1
Используется Astra Linux CE 2.12 без графического интерфейса, только терминал.
Задача: перед логином вывести IP адрес.
На Orcale Linux 7 используется init.d и всё хорошо отрабатывало с rc.local - перед логином при загрузке отображался IP.
Но при использовании systemd в Astra Linux CE столкнулся с тем, что rc-local в systemd запускается, но IP не отображается (в /etc/issue он не записан).

[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local
After=network-online.target

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

# 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.
# This unit gets pulled automatically into multi-user.target by
# systemd-rc-local-generator if /etc/rc.local is executable.
[Unit]
Description=/etc/rc.local Compatibility
ConditionFileIsExecutable=/etc/rc.local
After=network-online.target

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no

#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.

touch /var/lock/subsys/local

echo "rc.local is called..."
rm -rf /etc/issue
cp /etc/issue-standard /etc/issue
IP=`/sbin/ifconfig | grep "inet " | grep -v "127.0.0.1" | awk '{ print $2 }' | sed 's/\n//g'`
echo $IP >> /etc/issue
echo "" >> /etc/issue

\S
Kernel \r on an \m

БОЛЬШОЕ ЛОГО ТЕКСТ АРТ

Виртуальной машине присвоен IP адрес


Если запустить
Bash:
/etc/rc.local start
cat /etc/issue
то ip выводится.

Возможно After нужно изменить, но на что?

Прошу помощи.