Debian :: Run Script / Command Before Shutdown / Reboot In Jessie

Feb 20, 2016

How to run a script/command before shutdown/reboot in Debian Jessie.

I created a script in /etc/init.d/ to shutdown rTorrent if the reboot or shutdown now -h command was executed.

#rTorrent Shutdown Script
echo "Shutting down rTorrent!"
kill -2 `pidof rtorrent`

I set the file as executable.
sudo chmod +x /etc/init.d/

I inserted a symlink in the rc0.d directory with the process order K04.
sudo ln -s /etc/init.d/ /etc/rc0.d/

I also inserted a symlink in the rc6.d directory with the process order K04.
sudo ln -s /etc/init.d/ /etc/rc6.d/

Apparently rc0.d is for shutdown and rc6.d if for reboot

After reboot it appears that rtorrent does not run (I cannot connect to rtorrent via rutorrent) but really what is going on. I am trying to do this because rtorrent does a hash check on all files if it is not shutdown properly. I just want it to shutdown automatically and safely, before the system shuts down.

View 9 Replies


Debian Configuration :: Jessie Upgrade Ssh Command Line Reboot

Nov 13, 2015

I've upgraded a server on our LAN from fully functioning Wheezy to Jessie. All seems fine except remote administering using Putty from my windows workstation when issuing reboot from command line, it goes down and reboots but stops at login prompt asking for username and password and does not come back on the LAN network. This server does not normally have a monitor or keyboard so my ability to remote admin this server in effect is disabled.

If I log on, it will come back on the LAN network. I've checked the logs but can't see any errors. Is it in the configuration of Jessie somewhere or perhaps a Grub issue. I have 5 other production Wheezy servers that I intend to update to Jessie once I understand how to deal with this problem.

View 4 Replies View Related

Debian :: Reboot/shutdown Command Without Sudo?

Mar 11, 2011

I've added entries to my Openbox menu labeled Reboot and Shutdown. Problem is, reboot and shutdown h only work as root, and I never login as root. I've tried su-to-root -c reboot, but the menu entries remain unresponsive. I do not have sudo installed because I feel it is a security issue. However, I found that sudo reboot works with the menu entry, but only if my account is set to use sudo without a password in /etc/sudoers. I use tint2 as my panel, but have had no luck with finding a shutdown/reboot button.

View 4 Replies View Related

Debian :: 8.1 Jessie Very Slow Shutdown / Restart

Aug 25, 2015

I have been a Debian user for some time already, and lately I experienced a weird behaviour regarding shutdowns/restarts. The thing is my computer shuts down very very slowly, but not because of HDD activity, nor because of CPU activity (as far as I know, I may be wrong). It stops at some point, and after that, it hangs between 5 seconds and... even 5 minutes. The time in which comes back to normal and continues the shutdown process varies and has absolutely no pattern.

This is where it hangs (the last line appeared because I disconnected the mouse):

View 4 Replies View Related

Debian Multimedia :: Jessie XFCE GNOME - How To Shutdown

Jan 7, 2016

After I upgraded debian wheezy to debian jassie I cannot find how to switch off the computer from GNOME and XFCE. On GNOME I even cannot see a logout button. Where is it hidden?

View 3 Replies View Related

Debian Multimedia :: Jessie - LXDE Doesn't Shutdown Properly

May 19, 2015

I know the problem has been partly solved in this old thread [URL] .....

Now we have Jessie as stable, yet LXDE doesn't shutdown properly:

On the same computers, Wheezy LXDE shut down very fast

I installed Jessie from the netinstall image.

On a 2007 computer, it's like the old days with a Pentium II running some version of Puppy Linux or Slitaz. The system shuts down after a while but the computer remains on.

On a 2013 laptop, I added the line init=/bin/systemd in the Grub default file as advised on the old thread above. The laptop shuts down after a while, the system first, then the hard disk goes to sleep, then all the leds are off.

If I run the magic command, the computer shutdowns in a breeze, perhaps even quicker than good old Wheezy:

Code: Select all# systemctl poweroff

Now, is this still a systemd bug? Doesn't look like it since the systemctl command works. Is it an LXDE bug? Looks like it in a way - if the LXDE shutdown button enabled the systemctl poweroff command, I suppose the button would work?

Is there a way to make the LXDE shutdown button run the systemctl poweroff command?

I'm glad Wheezy is still with us because I wouldn't install Jessie for newbies — they'd think shutdown (through clicking on a button) is even worse than in Windows.

View 2 Replies View Related

Debian Configuration :: Jessie Will Not Reboot On Remote Server

Jun 27, 2015

Upgraded webserver to Jessie as an upgrade to Wheezy produced errors, and before reboot everything was up and running, but as all upgrade docs and info I read, I rebooted the server. However it never came back. I have the original backup files before I did the Wheezy upgrade. I also have access by Rescue to the server.Made a back up of critical files and have a 24GB tar file and I can connect by SFTP.

how to check the Debian files... Grub etc.. I would prefer to find the issue than start again.I am not able to sudo from Putty. I cannot run apt-get update. I did go to chroot, but then I get unable to resolve host errors and Could not open lock file because Permission denied errors and asking if I am root.There is information by googling for start up issues, but as I am working remotely with a Rescue set up, a lot of the commands I see and have tied do not work.

View 3 Replies View Related

Debian :: Dedi Server Don't Reboot After Wheezy / Jessie Upgrade

Jul 26, 2015

I have upgraded my debian server on april when Jessie came up, but I *forgot* to reboot at this time. As a new kernel* was released this week as a security update, and since my server installed it (via unattended-upgrade on security packages), I rebooted it last night. It never came back online.

I have access to a rescue boot (Ubuntu 12.04 LTS), and tried to analyse the failure (by mounting /sys /dev /proc and /boot and chrooting), but without luck so far.

As it's a dedicated server, I don't have access to the console. What I know :

No log in var/log since the failed reboot. I don't know how to have/find others logs.Previous kernel was 3.2.0-4-amd64, new is 3.16.0-4-amd64, What I tried without luck) :

Change the booting kernel, via update-grub. Tried 3.2, 3.2 with sysvinit and 3.16 rescue mode I think. I should have done it right, but without console it's hard to tell.apt-get update/apt-get upgrade/apt-get dist-upgradeadding nomodeset to kernel load in grubWhat I haven't tried :

update-initramfs, I don't really know why it would block the boot

*linux-image-3.16.0-4-amd64:amd64 3.16.7-ckt11-1+deb8u2

View 6 Replies View Related

Debian Configuration :: No Network After Reboot Of Scratch Install Of Jessie

May 2, 2016

I've been using various distros of Linux for over 20 years - but I'm stumped.

Was running Mint. But after taking an update a few weeks ago the network stopped working. After a lot of time and effort decided to give up on Mint and switch distros to Debian 8 Jessie.

But after changing the Network settings from default DHCP to my usual IPV4 static configuration and rebooting the network will not work.

I have several systems on a LAN behind another Linux system acting as firewall/gateway.

Now, after about 7 hours of mining the Internet, I still can't get basic networking to work:

- Have tried a few combinations, with and without Network Manager and eth0 in interfaces
- /etc/network/interfaces is configured with a static IP and relevant parameters
- ifconfig shows eth0 and the correct information
- netstat -rn shows the basic default route to the gateway
- have tried with IPV6 enabled and disabled; it is not used on my LAN

The box is a desktop system, ASUS Maximum VI Formula mobo with onboard Ethernet, dual GTX 780 cards. Nothing very weird.

It all LOOKS right, but ping can't get off the box "destination unreachable", and no other system on the LAN can ping it.

I'm amazed a basic static IPV4 network setup completely breaks it. This is my main workstation - a dual-boot system where Windows runs fine - so it's not hardware.

EDIT: This has been solved. See the solution post: [URL]

View 14 Replies View Related

Debian :: PC Not Capable To Shutdown Or Reboot?

Aug 10, 2010

I am facing the issue that the PC not capable to shutdown or reboot; In order to debug that, htop tells me the running processes but all seems normal, I killed few but still cold reset is needed.There is certainly a problem somewhere. the best would be to know which process are weirdly hanging. It could make this testing debian bit better to know which package has these issues.

View 1 Replies View Related

Debian Multimedia :: Debian Wheezy Xfce4, No Reboot, No Shutdown?

Sep 3, 2011

i have fresh installed debian wheezy xfce4, and using slim to start it but i can't get reboot, shutdown and thunar can't open flash and others volumes. i using .xinitrc (exec ck-launch-session startxfce4)

View 3 Replies View Related

General :: [FYI] "last -f <old Wtmp> -x Reboot Shutdown" Incorrect For Last Reboot And Shutdown?

Mar 25, 2010

Further to this LQ thread which Tinkster solved by suggesting the last command (thanks Tinkster) I have been exploring last -x reboot and have found that the reported duration is incorrect for the last reboot and shutdown when a old wtmp file is used. Not having a record for the following shutdown, last assumes that the system has been up until the current time and similarly for the shutdown.

The output comes in time order, latest first, each line showing the time of the reboot and the uptime from then to shutdown. Using last -x reboot shutdown to show the shutdown time, here's an illustration


shutdown system down Sun Mar 7 15:35 - 03:02 (11:27)
reboot system boot Sun Mar 7 09:35 (05:59)
09:35 until 15:35 is 05:59.

When the uptime exceeds 24 hours it is shown as (<days>+<hours:minutes) like this
shutdown system down Sun Feb 21 12:39 - 13:20 (00:40)
reboot system boot Sat Feb 20 09:39 (1+02:59)
09:39 until 12:39 the next day is 1 day 02:59.

The time in parentheses at the end of the shutdown lines is normally the time until the next shutdown.

So far so good. The incorrect output is for the last reboot and shutdown of an old wtmp file. Here's the output of last /var/log/wtmp -x reboot shutdown; last -f /var/log/wtmp.1 -x reboot shutdown


reboot system boot Fri Mar 12 07:42 (01:54)
shutdown system down Fri Mar 12 01:31 - 09:37 (08:05)
wtmp begins Thu Mar 11 08:25:26 2010
reboot system boot Wed Mar 10 14:12 (15+01:42)
shutdown system down Wed Mar 10 12:41 - 15:54 (15+03:13)

The boot started at "Wed Mar 10 14:12" which had an actual uptime of 1 day 11:20 is reported as 15 days 03:13 which is the time from then until the last -f /var/log/wtmp.1 -x reboot shutdown command was issued. The time from shutdown to shutdown is similarly affected.

View 1 Replies View Related

Debian :: Hang On Shutdown / Reboot - KVM Hardware Virtualization

Aug 25, 2015

Every shutdown/reboot always hangs on

Code: Select allkvm: exiting hardware virtualization

I have tried rebooting/shutting down with

Code: Select allshutdown -h now
shutdown -r now
init 0
init 6

And all hang on the same line. This is 100% reproducible. I am not actually running a virtual machine. I don't have qemu-kvm installed. I do have separate partitions on my system. I have a /boot, /, swap, and /home partition.

From looking at other posts: [URL] .....

Solutions tend to be across the board: not unmounting properly, acpi settings in grub, using a different shutdown command.

My fstab file is:

Code: Select all# /etc/fstab: static file system information.
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation

[Code] ....

and the result of Code: Select allmount is

Code: Select allsysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=498135,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,relatime,size=800408k,mode=755)

[Code] ....

View 2 Replies View Related

Debian :: Login Window Pops Up On Reboot/shutdown?

Jul 5, 2011

Every time I reboot or shutdown my PC, the login window shortly pops up. The PC does shutdown or reboot normally afterwards. When I use the terminal to shutdown/reboot (sudo shutdown -h now or sudo reboot) all goes well. The PC is running Debian Squeeze with the GNOME desktop environment.

View 7 Replies View Related

Debian Hardware :: Reboot / Restart Instead Of Shutdown (wheezy)

Oct 16, 2012

Come across with a situation where all methods of shutdown result in a restart/reboot? I've tried commands:

- shutdown
- halt
- poweroff

.. with various parameters, nothing works. The laptop seems to power off, but after a sec it restarts/reboots. I've Googled high and low, but there's very little on this topic. Maybe it is specific to the current kernel in Wheezy? I'm not suspecting a harware failure, since this was not happening with Windows installed.

This happens on me with Wheezy on a HP Elitebook 8530w.

View 14 Replies View Related

Debian :: Fighting With Making Running A Script At Startup Only But Not At Shutdown/reboot?

Nov 30, 2010

So I found many methods on google, but no one works. It seems that this one is THE Debian way.

# Provides: mystartupscript


View 5 Replies View Related

Debian :: How To Pair Bluetooth Keyboard Via Command Line On Jessie

Mar 27, 2015

I installed the Open Source Media Center (OSMC) on my Raspberry Pi 2. It's based on Debian Jessie. I bought a Blueooth Keyboard (Keysonic KSK-3211) and an USB-Bluetooth adapter (CSL Bluetooth Stick Nano). And now I am looking for a way to pair the keyboard with the raspberry via command line.

I'm new to all this bluetooth stuff in debian. It's the first time I try to install it. As far as I've understood I need an agent that is started with the pairing PIN. Then I type this PIN at the keyboard and that's it. Am I right?

The problem is, that every agent I've found in howtos or descriptions like bluez-simple-agent or bluetooth-agent (like described here [URL] ....) is not installed (and as far as I know can't be installed) under Jessie.

The bluetooth adapter is recognized

Code: Select allosmc@osmc:~$ hcitool dev
        hci0    00:1A:7D:DA:71:0C
the keyboard is found
Code: Select allosmc@osmc:~$ hcitool scan
Scanning ...
        00:12:A1:70:42:28       Bluetooth Keyboard

And I can ping the keyboard

Code: Select allosmc@osmc:~$ sudo l2ping 00:12:A1:70:42:28
Ping: 00:12:A1:70:42:28 from 00:1A:7D:DA:71:0C (data size 44) ...
0 bytes from 00:12:A1:70:42:28 id 0 time 14.82ms
0 bytes from 00:12:A1:70:42:28 id 1 time 9.91ms
0 bytes from 00:12:A1:70:42:28 id 2 time 32.62ms
0 bytes from 00:12:A1:70:42:28 id 3 time 28.81ms
^C4 sent, 4 received, 0% loss

So everything seems to be ok ... but I can't find the command for pairing the keyboard. Looks like something changed in Jessie so that the old tutorials are outdated.

View 2 Replies View Related

Debian :: System Rebooting On Shutdown -h Now Command

Aug 17, 2011

I am running Debian Squeeze on an Intel DH55TC motherboard. When I issue a shutdown command
shutdown -h now

The system goes shutting down. Eveything looks fine, and the main console shows all process being stopped. In the end it says "System will now halt". Then a few seconds later, it restarts. It is unclear what is causing this, because nothing is written to the screen. It just goes blank and starts rebooting. Looking afterwards in syslog doesn't show anything also.

View 14 Replies View Related

Server :: Unable To Shutdown/reboot Server, No Shutdown Process Running?

Mar 30, 2010

I'm trying to reboot the server (shutdown -r now).But it seems like nothing happened.

When I try "shutdown -c", the system prompts "shutdown: cannot find pid of running shutdown."

View 5 Replies View Related

Debian Configuration :: Ssh Doesn't Work After Sending Reboot Command

May 2, 2011

last week while I was using ssh to the computer1 inside a NAT as usual, I made another tunnel from the computer1 that I was connecting to, to another computer2 inside that NAT (ssh and after making some changes in computer2 I typed reboot. The computer2 rebooted but the tunnel totally hung and I had to kill it in my laptop. Since that day I haven't been able to ssh to the computer1 as I am used to.

Here is some more information:

debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/une/.ssh/id_rsa


View 3 Replies View Related

Ubuntu :: Shutdown Command Like Shutdown Button?

Dec 10, 2010

looking for a command that shutdown/reboot my ubuntu just same as process that happened when I press shutdown buttonIn fact I need to close all programs that are running and then PC shutdown (that happened when I press shutdown button).

View 9 Replies View Related

General :: Embedded Reboot Crash - Error Executing The Reboot Command

May 4, 2011

I'm working with Linux 2.6.23 on an embedded device and am receiving the following error executing the reboot command.

View 2 Replies View Related

Ubuntu :: Unable To Reboot / Shutdown

Mar 9, 2010

I have recently upgraded to the 10.04 Alpha and have been unable to reboot or shutdown. I know it's just an alpha and therefore problems are bound to exist, so I tried reinstalling from a live cd of Alpha 3. But I am still unable to reboot or shutdown.To clarify what happens, I click on shutdown or reboot, the pop-up appears, I click on the shutdown/reboot button and it seems to complete it. It says that processes have been killed and something has exited with 255. But my computer is still on. I am guessing that Ubuntu is shutting down, it's just not actually shutting my computer down or restarting it.

View 5 Replies View Related

Ubuntu :: Cannot SIGKILL - Can't Reboot - Shutdown?

Jul 15, 2010

I have a remote server (Xubuntu 10.04) which suffered an electricity brownout yesterday. The server itself is backed with an ups, but it is connected to a external firewire disk, which is not, and this disk malfunctioned as a result of the brownout.

The problem: Now, any process trying to access the external disk freezes and ends up in eternal D state in the process list, including ls and umount. Even trying to ls a directory which contains a symbolic link to a file in that drive just causes ls to freeze. These processes cannot be killed even with SIGKILL, so I proceeded to reboot but...

None of the reboot commands work. Instead they just get added to the ever increasing list of D state processes. I tried (sudo) shutdown -r now, reboot -f now and finally plain shutdown -h now. Is there anything else to try other than ask somebody to actually go to the server and pull the plug (which is not at all trivial)? Some way to tell kernel not to worry about messing stuff up, and just reboot?

View 1 Replies View Related

Ubuntu :: Failed Shutdown/reboot In 10.10?

Nov 23, 2010

we've just bought 30 newest nettops ACER Aspire R3700 with ION 2. I've tried ubuntu, kubuntu, xubuntu. Everything works as expected, but... the first one freezes when trying to reboot, shutdown or enter sleep mode. Checked on several hardware units. The desktop just freezes and nothing happens (ubuntu 10.10, both x32 and amd64). Also no one installs the wi-fi drivers, only ethernet

View 4 Replies View Related

Ubuntu :: Natty Won't Reboot / Shutdown - What To Do?

May 4, 2011

Natty won't shutdown for me - the start up/shutting down graphic comes up and the 'light' go down from 5 to 3 then it just hangs there.

Is there a shutdown log? I've looked in /var/log/messages but there's nothing relevant there.

View 3 Replies View Related

Ubuntu :: Shutdown Or Reboot Only Logs Out?

Jun 26, 2011

From a 11.04 Ubuntu, I installed the meta-package xfce4 (*). Now, in the xfce4 session, "suspend" and "logout" (from the xfce4-panel button) works, but "shutdowmn" and "reboot" not, they only lead to GDM. (the shutdowm option there works.)

I tried to solve that by installing the meta-package "xubuntu-desktop" (maybe there are some necessary settings included?), and in fact, the login-screen changed (it's still GDM, I suppose) and there is now a "xubuntu" session, but in that, the probem is just the same: shutdown only leads to the login screen.

In Gnome Classic or Unity, shutdowmn works as it shoulds, so it's not a general problem with my computer.

In Detail, in forst tried to install xfce4 with ubuntu-software-center, but although it seemed to succeed, there was no xfce session. In Synaptic, installing the xfce3 metapackage worked. In fact, software-center seemed to have overlooked some dependencies...

View 4 Replies View Related

Fedora X86/64bit :: 12 Crushes During Reboot & Shutdown?

Jan 4, 2010

Recently I installed Fedora 12 64bit in my HP Compaq 6720s. Among many other problems that I had and I solved with your help, I have the following problem:When I restart or shut-down Fedora 12 it crushes and hangs and only thing that I can do is to stop and restart my laptop by means of ON/OFF button.My question is:Is there any way to see this error (maybe some log file or something) so I can send this message or log file here in this forum and get some help?

View 1 Replies View Related

Fedora :: F13 Extra Long Reboot And Shutdown?

May 30, 2010

I hoping someone can point me in a direction. I installed F13 KDE from the live cd and now when I Shutdown or Reboot, it takes 2 minutes and 8 seconds for the machine to power off. Yes, I timed it.Happens everytime like that. Even when booting from both "mainstream" live cd and the KDE spin live cd. When I hit the Shutdown or Reboot, it goes through the daemons/services shutdown the flashes up the Halting System or Please wait while the system reboots messages (respectivley), turns off the LCD and then just... sits with the power light on and hard drive activity light on. I should mention this is on a Toshiba Laptop about 2 years old now. Intel Chipsets. (Satellite Pro S300M-S2142 if anyone is really curious). The hard drive light stays on for about 1:03 minutes and then it turns off, at 2:08 minutes - the Power light finally turns off and the thing finally shuts down or reboots. If this sounds familiar, it's because it is and I've posted about it with F12 and it's still there with F13. Running kernel-

View 1 Replies View Related

Fedora Servers :: Can't Reboot Or Shutdown Server

Feb 25, 2011

After a couple of days, some commands related to the disk (df) or files (ls) or killing process (kill -9) doesn't respond. Even I can't reboot or shutdown my server. After an hard reboot, some files are not here anymore or the log files are not filled anymore until I restart.My disk are behind the RAID controller i6 and are configure in RAID 1. The disks are two HP SCSI 72,8GB 10k RPM.Maybe I am totally wrong to check the disk access side, so I am open to other explanation.I can also add that my CPU is running under 1% et my RAM under 10%.

View 14 Replies View Related

Copyrights 2005-15, All rights reserved