Shutdown takes a long time [Solved]

Please post suggestions for improvement of Cinnamon on:
https://github.com/linuxmint/Cinnamon
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
cabbagetreemo
Level 3
Level 3
Posts: 147
Joined: Fri Mar 31, 2017 2:36 am
Location: Spain

Shutdown takes a long time [Solved]

Post by cabbagetreemo »

Recently my computer is taking a long time to shutdown and seems to get stuck at the mint logo with the flashing dots for quite a while.

I've seen a similar recent thread here: viewtopic.php?f=208&t=270232&p=1475675& ... n#p1475675 which is marked as solved except it is not clear to me how it was solved and I also noted that they are using Mint 18.3 with Kernel 4.10.0-38-generic x86_64 (64 bit) as I will show soon from the output of inxi -Fxz I am running Mint 18.2 with kernel 4.13.0-41-generic x86_64 (64 bit).
Also fro what I can tell in that thread, the problem was either an Nvidia driver or a CUPS driver. I don't have an Nvidia graphics chip so that rules out Nvidia driver and I haven't changed my CUPS driver.

In the last week or so I have installed jackd, qjackctl, and gnome-alsa-mixer but I think I am still using Pulseaudio unless I explicitly kill it to run qjackctl for specific applications.

I assume there is some sort of log I can look up but I don't know where it is. Here is the output of inxi -Fxz

Code: Select all

System:    Host: user-ThinkPad-T530 Kernel: 4.13.0-41-generic x86_64 (64 bit gcc: 5.4.0)
           Desktop: Cinnamon 3.4.6 (Gtk 3.18.9-1ubuntu3.3) Distro: Linux Mint 18.2 Sonya
Machine:   System: LENOVO (portable) product: 2359CTO v: ThinkPad T530
           Mobo: LENOVO model: 2359CTO Bios: LENOVO v: G4ET97WW (2.57 ) date: 10/17/2013
CPU:       Dual core Intel Core i5-3230M (-HT-MCP-) cache: 3072 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 10376
           clock speeds: max: 3200 MHz 1: 3024 MHz 2: 2949 MHz 3: 2971 MHz 4: 2941 MHz
Graphics:  Card: Intel 3rd Gen Core processor Graphics Controller bus-ID: 00:02.0
           Display Server: X.Org 1.18.4 drivers: intel (unloaded: fbdev,vesa) Resolution: 1366x768@60.00hz
           GLX Renderer: Mesa DRI Intel Ivybridge Mobile GLX Version: 3.0 Mesa 12.0.6 Direct Rendering: Yes
Audio:     Card Intel 7 Series/C210 Series Family High Definition Audio Controller
           driver: snd_hda_intel bus-ID: 00:1b.0
           Sound: Advanced Linux Sound Architecture v: k4.13.0-41-generic
Network:   Card-1: Intel 82579LM Gigabit Network Connection driver: e1000e v: 3.2.6-k port: 6080 bus-ID: 00:19.0
           IF: enp0s25 state: down mac: <filter>
           Card-2: Realtek RTL8188CE 802.11b/g/n WiFi Adapter driver: rtl8192ce port: 4000 bus-ID: 03:00.0
           IF: wlp3s0 state: up mac: <filter>
Drives:    HDD Total Size: 500.1GB (6.2% used) ID-1: /dev/sda model: CT500MX500SSD1 size: 500.1GB
Partition: ID-1: / size: 89G used: 22G (26%) fs: ext4 dev: /dev/sda5
           ID-2: swap-1 size: 8.27GB used: 0.00GB (0%) fs: swap dev: /dev/sda6
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 45.0C mobo: N/A
           Fan Speeds (in rpm): cpu: 0
Info:      Processes: 198 Uptime: 40 min Memory: 1300.8/7677.8MB Init: systemd runlevel: 5 Gcc sys: 5.4.0
           Client: Shell (bash 4.3.481) inxi: 2.2.35 
In case it matters, this computer is dual booted with Windows7. Also I have not noticed an increase in startup times (about 5 - 10 seconds from grub to desktop).
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
cabbagetreemo
Level 3
Level 3
Posts: 147
Joined: Fri Mar 31, 2017 2:36 am
Location: Spain

Re: Shutdown takes a long time

Post by cabbagetreemo »

I haven't made much progress but I recorded a slow motion video of the shutdown messages and went through frame by frame to discover that the hanging process was
session c2 of user
I found a few forum posts which suggest using loginctl session-status c2 > /root/session-c2.txt to find the process within the session but then the computer has decided not to hang for the last few shutdowns...
User avatar
Flemur
Level 20
Level 20
Posts: 10097
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Shutdown takes a long time

Post by Flemur »

cabbagetreemo wrote: Sat Jun 16, 2018 7:29 amI haven't made much progress but I recorded a slow motion video of the shutdown messages and went through frame by frame
!! Great idea!
to discover that the hanging process was
session c2 of user
I found a few forum posts which suggest using loginctl session-status c2 > /root/session-c2.txt to find the process within the session but then the computer has decided not to hang for the last few shutdowns...
Maybe you fixed it. Next time - if you're unlucky - the problem pops up see if it's in "dmesg" (I'm not sure exactly what goes in there):

Code: Select all

dmesg | grep ession
Does it say "a stop job is running for Session c2 ... " ? I've seen various solutions for that, the worst is changing a timeout value from 90 seconds to 10 seconds, others involve stopping a service or killing a process before shutdown.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
User avatar
cabbagetreemo
Level 3
Level 3
Posts: 147
Joined: Fri Mar 31, 2017 2:36 am
Location: Spain

Re: Shutdown takes a long time

Post by cabbagetreemo »

I don't see the "a stop job is running..." message with the counter other people mention but it does wait 90 seconds before moving on.
I don't think I fixed it because I didn't change anything between the hanging and not hanging the dmesg will depend on whether the hang comes before or after unmounting drives, I suppose. You might remember me from my other post about running a shutdown script but it seems that thunderbird/kdocker wasn't the problem; I found a post where someone managed to get a log and from reading the log it seemed that their problem was chromium - I always close my windows before shutdown but I added a killall chromium to my shutdown script for good measure.
User avatar
cabbagetreemo
Level 3
Level 3
Posts: 147
Joined: Fri Mar 31, 2017 2:36 am
Location: Spain

Re: Shutdown takes a long time

Post by cabbagetreemo »

I learned that killall chromium doesn't work because of subtle differences in process names. After a while of no problems I experienced that shutdown delay again but this time I actually got the 'a stop job is running...' message. The count down timer was set to a whopping 10 minutes and it seemed there were two culprits the same session of user c2 with 90 second timer and mysql with 10 minutes. I have now edited /etc/init/mysql.conf to remove the start on commdand (which I realise means I now have to manually start mysql when I want to query my databases and changed my shutdown script to include pkill chromium and pkill mysql
Pakha
Level 1
Level 1
Posts: 29
Joined: Sun Jul 01, 2018 7:39 am
Location: Ukraine

Re: Shutdown takes a long time

Post by Pakha »

Go to /etc/systemd/, open as root system.conf and uncomment row DefaultTimeoutStopSec and change to 10 sec. This method works for me in LMC 18.3.
Last edited by Pakha on Sun Jul 08, 2018 2:27 am, edited 1 time in total.
User avatar
cabbagetreemo
Level 3
Level 3
Posts: 147
Joined: Fri Mar 31, 2017 2:36 am
Location: Spain

Re: Shutdown takes a long time

Post by cabbagetreemo »

That's a reasonable method but I guess it subverts the problem rather than solving it. I discovered that in the advanced settings of Chromium there is an option which is selected by default to "keep background processes running when closed" disabling this solves the problem with Chromium. Even though I only saw the issue with mySQL one time, keeping it disabled until I need to access a database and disabling again when I'm done with the database is a suitable solution for me.
Locked

Return to “Cinnamon”