Hi to all.
My first message here, but i following you via twitter feed from many time...
The question:
I need to delay 5-10 seconds the shutdown command executed when the user click on the power off/reboot in their session or at login screen.
I need that because i have in the background a process that need to comunicate with a remote MySQL server login or logout of the users. In the normal case the shutdown process bring the network interface down before the local script can set a new logout record on DB.
I don't know what gnome execute when system is halted o rebooted.
I have tried this solution:
mv /sbin/shutdown /sbin/shutdown.bin
pico /sbin/shutdown
...but strangely the system wait 10 seconds then reboot even when i call shutdown from gnome...
How is your background process started, and how do you signal it to log out? Maybe a service script in /etc/init.d (with appropriate entries in the required runlevel(s)) would solve your problem better than tinkering with shutdown.
I'm not that fit with upstart, but as far as I know the MySQL startup script can be made a dependency of your script. I think (but not sure) that the line should be something like this:
This should start your script as soon as the network interface becomes available, and stop it when the system starts to shutdown/reboot.
ok,
currently don't have declared any stop @ runlevel for this process.
The script must have the time to intercept the disconnection of 'user, which normally happens at shutdown.
At this point we think we need to play with the times, allowing the script to understand that the 'user is no longer connected and communicate to the MySQL server, the first turning off or disable the' network interface
Remember, the script generates a loop that repeats every three seconds to 'inside of which are recognized as the users who are connected or disconnected .. and communicates with mysql..
Hi,
I am trying to understand what would happen if ther is a loop without any delay like sleep statement, I feel that would add a lot of load onto the CPU. Trying to understand how the load is reduced by the introduction of sleep().
Thanks and regards
Zulfi (3 Replies)
I have a list of URLs that I need to download in a file.
I know I can use the -i option to load the URLs from the file, but how can I make Wget wait a couple secs between each URL download? (4 Replies)
I've got critical patching this weekend on 6 HP UX machines, back to back and the customer has requested to shutdown, and halt the machines and to bring it up at a later period. The thing is the servers are located offshore and we are just the support team. I have a special login thru a console... (16 Replies)
I have Oracle 9i R2 on AIX 5.2. My Database is running in shared server mode (MTS).
Sometimes when I shutdown the database it shutsdown cleanly in 4-5 mints and sometimes it takes good 15-20 minutes and then I get some ora-600 errors and only way to shutdown is by opening another session and... (7 Replies)
Hi Experts,
I am running solris 9. Sun-Fire 880.
How do i shutdowon the whole server using ALOM i.e sc> console.
If the server is down or somehow hang How do i Restart from sc>
//purple (6 Replies)
Hi,
I have a doubt in introducing a delay in the programs.
We know that we do have a sleep() function/api using which
we can bring a delay in terms of seconds.
A minimum delay can be atleast 1 second.
Now I'm bothered about how to introduce a delay that is just
less than a second. Like... (3 Replies)
Working on AIX 4.3
I have an active exe that accepts files for processing on our RS6000. Day to day i store these files in a secure place and at the end of the day I mv them one by one. After some reading and ofcourse trial and error i figured out that this helps...
mv `ls -l |head -l | awk... (2 Replies)