Debian - Run script on startup and display results in console - before user login
up vote
0
down vote
favorite
How to run script on startup and display results in console - before user login? I've tried to put script in /etc/rc.local but result - of course are not printed to console.
Particularly I want to print machine's IP address and maybe some other info in console after vm startup.
debian console
add a comment |
up vote
0
down vote
favorite
How to run script on startup and display results in console - before user login? I've tried to put script in /etc/rc.local but result - of course are not printed to console.
Particularly I want to print machine's IP address and maybe some other info in console after vm startup.
debian console
problem solved.. I just write an ip address to /etc/issue... thanks!
– integratorIT
Nov 29 at 8:19
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
How to run script on startup and display results in console - before user login? I've tried to put script in /etc/rc.local but result - of course are not printed to console.
Particularly I want to print machine's IP address and maybe some other info in console after vm startup.
debian console
How to run script on startup and display results in console - before user login? I've tried to put script in /etc/rc.local but result - of course are not printed to console.
Particularly I want to print machine's IP address and maybe some other info in console after vm startup.
debian console
debian console
asked Nov 22 at 12:22
integratorIT
670615
670615
problem solved.. I just write an ip address to /etc/issue... thanks!
– integratorIT
Nov 29 at 8:19
add a comment |
problem solved.. I just write an ip address to /etc/issue... thanks!
– integratorIT
Nov 29 at 8:19
problem solved.. I just write an ip address to /etc/issue... thanks!
– integratorIT
Nov 29 at 8:19
problem solved.. I just write an ip address to /etc/issue... thanks!
– integratorIT
Nov 29 at 8:19
add a comment |
1 Answer
1
active
oldest
votes
up vote
-1
down vote
The content displayed before the prompt is located in /etc/issue.
You can create a systemd script that will fill this file with useful informations at startup (using a systemd service file is the correct way to start something at boot). Combo : the systemd script can be "network-dependent" (After=network.target), and start only when network is ready.
Personnally, I also use /etc/issue.net to write down a warning message for people trying to access the SSH (civil liability for unauthorized access, and so on). Think of it as a sort of "SSH banner".
You can also use /etc/motd to display something when the user has logged in.
Nota Bene : the changes on /etc/issue are visible after a reboot (your script must have run before the last reboot).
Hi. /etc/issue only displays an information - plain text - you cannot put sctipt into /etc/issue.
– integratorIT
Nov 25 at 18:06
I didn't say that you could put a script in it.
– notanexpert
Nov 26 at 19:04
You didn't either provide soultion to my problem...
– integratorIT
yesterday
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
-1
down vote
The content displayed before the prompt is located in /etc/issue.
You can create a systemd script that will fill this file with useful informations at startup (using a systemd service file is the correct way to start something at boot). Combo : the systemd script can be "network-dependent" (After=network.target), and start only when network is ready.
Personnally, I also use /etc/issue.net to write down a warning message for people trying to access the SSH (civil liability for unauthorized access, and so on). Think of it as a sort of "SSH banner".
You can also use /etc/motd to display something when the user has logged in.
Nota Bene : the changes on /etc/issue are visible after a reboot (your script must have run before the last reboot).
Hi. /etc/issue only displays an information - plain text - you cannot put sctipt into /etc/issue.
– integratorIT
Nov 25 at 18:06
I didn't say that you could put a script in it.
– notanexpert
Nov 26 at 19:04
You didn't either provide soultion to my problem...
– integratorIT
yesterday
add a comment |
up vote
-1
down vote
The content displayed before the prompt is located in /etc/issue.
You can create a systemd script that will fill this file with useful informations at startup (using a systemd service file is the correct way to start something at boot). Combo : the systemd script can be "network-dependent" (After=network.target), and start only when network is ready.
Personnally, I also use /etc/issue.net to write down a warning message for people trying to access the SSH (civil liability for unauthorized access, and so on). Think of it as a sort of "SSH banner".
You can also use /etc/motd to display something when the user has logged in.
Nota Bene : the changes on /etc/issue are visible after a reboot (your script must have run before the last reboot).
Hi. /etc/issue only displays an information - plain text - you cannot put sctipt into /etc/issue.
– integratorIT
Nov 25 at 18:06
I didn't say that you could put a script in it.
– notanexpert
Nov 26 at 19:04
You didn't either provide soultion to my problem...
– integratorIT
yesterday
add a comment |
up vote
-1
down vote
up vote
-1
down vote
The content displayed before the prompt is located in /etc/issue.
You can create a systemd script that will fill this file with useful informations at startup (using a systemd service file is the correct way to start something at boot). Combo : the systemd script can be "network-dependent" (After=network.target), and start only when network is ready.
Personnally, I also use /etc/issue.net to write down a warning message for people trying to access the SSH (civil liability for unauthorized access, and so on). Think of it as a sort of "SSH banner".
You can also use /etc/motd to display something when the user has logged in.
Nota Bene : the changes on /etc/issue are visible after a reboot (your script must have run before the last reboot).
The content displayed before the prompt is located in /etc/issue.
You can create a systemd script that will fill this file with useful informations at startup (using a systemd service file is the correct way to start something at boot). Combo : the systemd script can be "network-dependent" (After=network.target), and start only when network is ready.
Personnally, I also use /etc/issue.net to write down a warning message for people trying to access the SSH (civil liability for unauthorized access, and so on). Think of it as a sort of "SSH banner".
You can also use /etc/motd to display something when the user has logged in.
Nota Bene : the changes on /etc/issue are visible after a reboot (your script must have run before the last reboot).
edited Nov 23 at 22:25
answered Nov 23 at 22:20
notanexpert
243
243
Hi. /etc/issue only displays an information - plain text - you cannot put sctipt into /etc/issue.
– integratorIT
Nov 25 at 18:06
I didn't say that you could put a script in it.
– notanexpert
Nov 26 at 19:04
You didn't either provide soultion to my problem...
– integratorIT
yesterday
add a comment |
Hi. /etc/issue only displays an information - plain text - you cannot put sctipt into /etc/issue.
– integratorIT
Nov 25 at 18:06
I didn't say that you could put a script in it.
– notanexpert
Nov 26 at 19:04
You didn't either provide soultion to my problem...
– integratorIT
yesterday
Hi. /etc/issue only displays an information - plain text - you cannot put sctipt into /etc/issue.
– integratorIT
Nov 25 at 18:06
Hi. /etc/issue only displays an information - plain text - you cannot put sctipt into /etc/issue.
– integratorIT
Nov 25 at 18:06
I didn't say that you could put a script in it.
– notanexpert
Nov 26 at 19:04
I didn't say that you could put a script in it.
– notanexpert
Nov 26 at 19:04
You didn't either provide soultion to my problem...
– integratorIT
yesterday
You didn't either provide soultion to my problem...
– integratorIT
yesterday
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1377552%2fdebian-run-script-on-startup-and-display-results-in-console-before-user-logi%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
problem solved.. I just write an ip address to /etc/issue... thanks!
– integratorIT
Nov 29 at 8:19