I'm pretty sure that the process must run somewhere I just can't locate it.
Reloading inittab with the getty line starts the serial command prompt but it
is not shown anywhere.

All the following information is taking on the serial interface.

find /proc -mindepth 2 -maxdepth 2 -name exe -exec ls -lh {} \; 2>/dev/null
lrwxrwxrwx    1 root     root           0 Mar 22 07:08 /proc/1/exe -> 
/bin/busybox (initroot)
lrwxrwxrwx    1 root     root           0 Mar 22 07:08 /proc/114/exe -> 
/bin/busybox (/sbin/syslogd-D-s2048-b3)
lrwxrwxrwx    1 root     root           0 Mar 22 07:08 /proc/116/exe -> 
/bin/busybox (/sbin/klogd)
lrwxrwxrwx    1 root     root           0 Mar 22 07:08 /proc/119/exe -> 
/bin/busybox (/usr/sbin/crond)
lrwxrwxrwx    1 root     root           0 Mar 22 07:08 /proc/129/exe -> 
/bin/busybox (watchdog-T255-t30/dev/watchdog)
lrwxrwxrwx    1 root     root           0 Mar 22 07:08 /proc/340/exe -> 
/bin/busybox ( -shroot)

 ps ax
PID   USER     TIME   COMMAND
    1 root       0:01 init
    2 root       0:00 [kthreadd]
    3 root       0:05 [ksoftirqd/0]
    4 root       0:00 [kworker/0:0]
    5 root       0:00 [kworker/0:0H]
    6 root       0:00 [kworker/u2:0]
    7 root       0:00 [lru-add-drain]
    8 root       0:00 [watchdog/0]
    9 root       0:00 [kdevtmpfs]
   10 root       0:00 [khungtaskd]
   11 root       0:00 [oom_reaper]
   12 root       0:00 [writeback]
   13 root       0:00 [kcompactd0]
   14 root       0:00 [crypto]
   15 root       0:00 [kintegrityd]
   16 root       0:00 [bioset]
   17 root       0:00 [kblockd]
   18 root       0:00 [watchdogd]
   20 root       0:00 [kswapd0]
   49 root       0:00 [spi1]
   52 root       0:00 [deferwq]
   53 root       0:00 [bioset]
   54 root       0:01 [mmcqd/0]
   55 root       0:00 [bioset]
   56 root       0:00 [mmcqd/0boot0]
   57 root       0:00 [bioset]
   58 root       0:00 [mmcqd/0boot1]
   59 root       0:00 [kworker/0:2]
   60 root       0:00 [jbd2/mmcblk0p6-]
   61 root       0:00 [ext4-rsv-conver]
   68 root       0:00 [jbd2/mmcblk0p7-]
   69 root       0:00 [ext4-rsv-conver]
   85 root       0:01 udevd --daemon
  114 root       0:00 /sbin/syslogd -D -s 2048 -b 3
  116 root       0:00 /sbin/klogd
  119 root       0:00 /usr/sbin/crond
  129 root       0:00 watchdog -T 255 -t 30 /dev/watchdog
  205 root       0:00 [kworker/u2:2]
  213 root       0:00 [ipv6_addrconf]
  216 root       0:00 /usr/sbin/dropbear -p 22 -I 900 -b /etc/banner
  228 www        0:00 /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
  230 www        0:00 /usr/bin/php-cgi -c /etc/php5/php.ini
  233 www        0:00 /usr/bin/php-cgi -c /etc/php5/php.ini
  265 root       0:00 [kworker/0:1H]
  340 root       0:00 -sh
  506 nobody     0:00 avahi-daemon: running [xxx.local]
  507 nobody     0:00 avahi-daemon: chroot helper
 1973 root       0:00 udevd --daemon
 1975 root       0:00 udevd --daemon
 2200 nobody     0:00 /usr/sbin/dnsmasq
 2966 root       0:00 /usr/sbin/chronyd -f /etc/chrony/chrony.conf
 4832 root       0:00 sleep 1
 4834 root       0:00 ps ax

Venlig hilsen / Best regards

Lars Alex Pedersen
Development Engineer
Technology

Kamstrup A/S
Industrivej 28
DK-8660 Skanderborg
T: +45 89 93 10 00
D: +45 89 93 15 42

[email protected]
kamstrup.com


-----Original Message-----
From: Mike Frysinger [mailto:[email protected]]
Sent: 17. marts 2017 20:19
To: Lars Alex Pedersen <[email protected]>
Cc: [email protected]
Subject: Re: getty hidden process

On 17 Mar 2017 10:24, Lars Alex Pedersen wrote:
> I'm trying to enable and disable getty using inittab as we has a
> usecase to lock down the serial port depending on a configuration
> value. By commenting the getty line out in inittab and sending a "kill
> -HUP -1" it will reload the inittab config and kill processes that has
> been removed. Adding getty to inittab and reloading init works fine
> but stopping it doesn't. Afterwards I discovered that getty must be
> running hidden since I couldn't find it in top/ps or /proc.
>
> Tested using busybox 1.24.2 and 1.21.x and know that we have seen
> getty before as a process in an older version of busybox.

userspace cannot hide processes from the kernel.  if it's not in /proc, then
it's because it doesn't exist.  please double check things.
-mike

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to