# smbd & python2.7 stuck in top state zio>i



## ghostcorps (Sep 23, 2013)

Hi guys,

I have started having some serious issues with smbd at the moment.

Samba has been used to connect my FreeBSD media server to my Windows 7 HTPC for years and now, after a few days operation, it seizes up suddenly and takes minutes to open a directory. The only fix I have found is a full reboot.

The Media server has a 9 TB RAID-Z array which is healthy.


```
#zpool status -x
all pools are healthy
```

The I run `top` I see that python2.7 and many smbd services are stuck in top state zio>i. Which makes me think python2.7 is locking my ZFS array and smbd is getting stuck behind it. 


```
last pid: 37609;  load averages:  0.11,  0.18,  0.16  up 3+14:31:55    07:53:24
126 processes: 2 running, 124 sleeping

Mem: 186M Active, 573M Inact, 1606M Wired, 75M Cache, 315M Buf, 522M Free
Swap: 2048M Total, 177M Used, 1871M Free, 8% Inuse


  PID USERNAME    THR PRI NICE   SIZE    RES STATE   C   TIME   WCPU COMMAND
 2014 root         32  44    0   373M 99732K zio->i  1 268:19  2.98% python2.7
90586 root          1  76    0  8344K  1844K wait    0   0:08  0.68% sh
 2661 root          3  44    0 85992K 12448K kqread  1  37:55  0.10% rtorrent
 8788 root          1  51    0 39800K  3988K zio->i  0 218:51  0.00% smbd
 1825 mysql        16  60    0   194M  7288K sigwai  1   1:48  0.00% mysqld
 1540 root          1  44    0 77044K   680K kqread  1   0:23  0.00% php-fpm
 1899 root          2  44    0 11236K   768K select  0   0:16  0.00% hsflowd
 1922 root          3  44    0  7684K   324K nanslp  0   0:13  0.00% hptsvr-htt
 2692 root          1  44    0   139M  1240K select  0   0:05  0.00% httpd
 1863 root          1  44    0 12036K  1192K select  1   0:04  0.00% sendmail
 2660 root          1  44    0  9404K   528K select  0   0:03  0.00% screen
39876 root          1  56    0 39800K  5060K zio->i  1   0:03  0.00% smbd
39875 root          1  54    0 39800K  5036K zio->i  1   0:02  0.00% smbd
 1844 root          1  44    0 50548K  5132K select  1   0:01  0.00% python2.7
80969 ghostcorps    1  44    0 38108K  4364K select  0   0:01  0.00% sshd
 1552 root          1  44    0 13536K   716K select  0   0:01  0.00% openvpn
80998 root          1  55    0 39908K  5384K zio->i  1   0:01  0.00% smbd
11156 ghostcorps    1  44    0 38108K  1416K select  1   0:01  0.00% sshd
```

Does this look familiar to anyone?

I am in the process of updating the services and expect that should fix it but if not what else should I look into?

Thanks guys


----------



## ghostcorps (Sep 24, 2013)

I have isolated the issue to a python script from my Usenet client:


```
#ps
  PID  TT  STAT      TIME COMMAND
 2014   1  Ts+  269:51.93 /usr/local/bin/python2.7 -OO /usr/local/bin/SABnzbd.py
```

I have tried everything I can think of to kill it but it will not die. First I attempted to shut it down from the SABnzbd webUI, no dice. It is run manually from a screen session so I tried `ctrl+c` within screen to no avail. I've tried `killall -9`, `killall -SIGCONT` and `killall -SIGSTOP` but it keeps on keeping on. 

I could easily restart but at this point I think it's important to know how to stop something like this without shutting everything down.

[update] The stuck services cause the shutdown to drop to `single user mode` and hangs.

Sorry @DutchDaemon, it has been a while since I've posted. I am out of practice


----------

