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.



enter image description here










share|improve this question






















  • problem solved.. I just write an ip address to /etc/issue... thanks!
    – integratorIT
    Nov 29 at 8:19















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.



enter image description here










share|improve this question






















  • problem solved.. I just write an ip address to /etc/issue... thanks!
    – integratorIT
    Nov 29 at 8:19













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.



enter image description here










share|improve this question













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.



enter image description here







debian console






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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


















  • 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










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).






share|improve this answer























  • 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











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















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

























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).






share|improve this answer























  • 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















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).






share|improve this answer























  • 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













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).






share|improve this answer














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).







share|improve this answer














share|improve this answer



share|improve this answer








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


















  • 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


















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

QoS: MAC-Priority for clients behind a repeater

Ивакино (Тотемский район)

Can't locate Autom4te/ChannelDefs.pm in @INC (when it definitely is there)