You are not logged in.

#1 2012-09-03 22:12:57

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

[SOLVED] Systemd Slow Poweroff, It was tor.service

Hello,

I have a full/native sytemd setup. It was working fantastic startup/shutdown faster then I could snap my fingers (Samsung 830 SSD). This is a fresh/clean 2 day old arch64 install on a new laptop.

However, just recently it has started to hang for about ... 30secs on poweroff. I did the stuff to get a log made and posted it to pastbin. I read through all of it and can't see anything wrong? I grep for timeout (and imeout) and get nothing

http://pastebin.com/vB2i8FCs


Dose anyone know what else I could do to help track down the problem.

I have disabled all the new services that I enabled... that I can remember. Still the same problem.


Thanks in advance smile

Last edited by hunterthomson (2012-09-04 01:00:39)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#2 2012-09-03 23:47:31

shinasha
Member
Registered: 2012-08-04
Posts: 19

Re: [SOLVED] Systemd Slow Poweroff, It was tor.service

Are you using Tomboy Notes? If I don't close Tomboy before shutting down my system hangs for a long time.

Offline

#3 2012-09-04 00:22:05

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: [SOLVED] Systemd Slow Poweroff, It was tor.service

hum, no I am not running tomboy notes.

I'm digging through all the .service files now... still trying one by one.


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#4 2012-09-04 00:59:34

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: [SOLVED] Systemd Slow Poweroff, It was tor.service

Awe, okay, that script:
/lib/systemd/system-shutdown/debug.sh
#!/bin/sh
mount -o remount,rw /
dmesg > /shutdown-log.txt
mount -o remount,ro /

That:
http://freedesktop.org/wiki/Software/sy … Eventually

Tells you to make keeps overwrighting the logfile /shutdown-log.txt when you reboot... I had to boot into the Archlinux LiveUSB then mount root and read the log file.
...?... hum, Really you just need to change
dmesg > /shutdown-log.txt
to
dmesg >> /shutdown-log.txt
Boy I should have noteced that one... but hum.. should this not just be running at shutdown....anyway, making it appened intead of overwrite will fix the script you don't have to boot into a LiveUSB/CD

When I did that I quickly noteced the timestamps. I could see an 30sec lag.. Then tor.service was stoped.
So, I disabled tor.service and sure enogh I am back to a crazy fast shutdown. I also noticed the lag when I ran:

systemctl stop tor.service

... Boy, I figured it was one of the service files I created? Owe well, I figured it out. I'll modify that service file, so I don't have to wait on it.

Last edited by hunterthomson (2012-09-04 01:11:57)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#5 2012-09-04 01:13:07

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: [SOLVED] Systemd Slow Poweroff, It was tor.service

Awe, yes it is clearly tor and clearly 30secs

Sep 03 15:09:37 walnut Tor[2190]: Interrupt: we have stopped accepting new connections, and will shut down in 30 seconds. In...xit now.
Sep 03 15:10:07 walnut Tor[2190]: Clean shutdown finished. Exiting.

I'm going to read up on Tor and see how to cleanly shutdown fast.


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#6 2012-09-04 01:27:43

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: [SOLVED] Systemd Slow Poweroff, It was tor.service

Okay changeing the tor.service file to send SIGTERM instead of SIGINT solves the problem. From what I could read though this may cause problems if you stop then start Tor too soon. The Tor guys put that lag in there to make sure the relays are shut down cleanly. So, just keep this in mind if you make the change i.e. wait like 30secs before starting Tor again.

However, I see no reason why this should be a problem if your turing off you computer. Also, it has that line in there for ExecReload with the -HUP so that should still work fine.

[Unit]
Description=Anonymizing Overlay Network

[Service]
Type=forking
GuessMainPID=yes
EnvironmentFile=/etc/conf.d/tor
ExecStart=/usr/bin/tor -f $TOR_CONF $TOR_ARGS
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGTERM

[Install]
WantedBy=multi-user.target

OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

Board footer

Powered by FluxBB