SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to run interactive yesno dialog when slackware is shutting down. The dialog works but unable to interact the dialog using keyboard. Is there any workaround for allowing keyboard input when dialog is shown during system shutdown?
What are you actually trying to accomplish? In almost all cases when a user wants the computer to shut down, he really wants it to shut down with asking again and again.
How to run interactive yesno dialog when slackware is shutting down. The dialog works but unable to interact the dialog using keyboard. Is there any workaround for allowing keyboard input when dialog is shown during system shutdown?
The "best" way to have what you want is to call your script from /etc/rc.d/rc.6 in line 79-80.
I dont know what you want to do... but in my case I have some scripts running during shutdown-restart from there and working very good. one of them is eliloconfig which running IF kernel was upgraded in the current session by slackpkg and I forgot to run eliloconfig and keybord works fine in dialog mode...
Note that when sysvinit-scripts rebuild or upgrade from Pat you have to keep your mind to not overwrite rc.6... or you must do it, then edit it again to place your script command in line 79-80...
But as I said idk what you want to do exactly...maybe this risking solution its not good for you.
Last edited by rizitis; 09-08-2023 at 10:56 AM.
Reason: fix typos
Another option would be in /etc/rc.d/rc.local_shutdown
Is it sure that keyboard will work properly to finish yesno dialog questions and commands when script is called from rc.local? I think no but dependents what exactly the user want to do...
I think rc.local_shutdown is the best option to stop daemons and services during shutdowns.
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 934
Rep:
Quote:
Originally Posted by rizitis
Is it sure that keyboard will work properly to finish yesno dialog questions and commands when script is called from rc.local? I think no but dependents what exactly the user want to do...
I think rc.local_shutdown is the best option to stop daemons and services during shutdowns.
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 934
Rep:
In a -current VirtualBox vm, this is the result using /etc/rc.d/rc.local_shutdown
/etc/rc.d/rc.local_shutdown
Code:
#!/bin/bash
#
# /etc/rc.d/rc.local: Local system initialization script.
#
# Put any local startup commands in here. Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.
echo '$USER:' >/tmp/local_shutdown
echo $USER >>/tmp/local_shutdown
echo -e '\n$PATH:' >>/tmp/local_shutdown
echo $PATH >> /tmp/local_shutdown
echo -e '\nset:' >>/tmp/local_shutdown
set >>/tmp/local_shutdown
echo -e '\nenv:' >>/tmp/local_shutdown
env >>/tmp/local_shutdown
dialog --textbox /tmp/local_shutdown 0 0
dialog --yesno foobar 0 0
When I logged into command line without launching desktop environment and run reboot/poweroff (even loginctl reboot/poweroff) the interactive script works. Both dialog works and the keyboard input works. However when reboot/poweroff was launched from desktop environment. The dialog works but the keyboard does not work to select option on the dialog.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.