[SOLVED] Finding out which process calls a program/script ("/sbin/usbmod")
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Rep:
Finding out which process calls a program/script ("/sbin/usbmod")
SuSE 11.2, KDE 4.2 after logging in to runlevel 5:
I have a process which is calling every 5 seconds /sbin/usbmod (which doesn't exist, hence I get lots of errors when I go to the screen with the boot messages). I want to know which process does the calling. How can I find out?
SuSE 11.2, KDE 4.2 after logging in to runlevel 5:
I have a process which is calling every 5 seconds /sbin/usbmod (which doesn't exist, hence I get lots of errors when I go to the screen with the boot messages). I want to know which process does the calling. How can I find out?
Might be a daemon, or cron, or other thing. If it doesn't exist, you could always create a stub to stop the messages. Although a stub might also cause unknown issues as well.
Code:
#!/bin/sh
exit 0
Or just find it and install it.
$ apt-file find /sbin/usbmod
(or whatever the SuSE equivalent is.)
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Original Poster
Rep:
@ Valery Reznic Worked like a charm, thanks a load. I created the script just like you suggested and made it executable. Since the job runs every 5 seconds I had not even to pause to get the result(s). Via "ps ax | grep <PID>" I got the culprit: /sbin/HWActivator. That is (possibly) needed for my WLAN USB-connector, which I got too recently to be sure about its being really needed. Its intended purpose is to switch the USB-stick from memory to modem state.
@ Shadow_7 It runs for a very brief moment every 5 seconds, I'm not sure how much luck I'd need to hit the same time slot by hand . For what it is, see above. With "stub" you mean an empty job which does nothing but prevent the error message, I presume. Well, I found usbmod but I don't really understand what it does (in particular how it assigns its option "$1" a value):
Code:
#! /bin/bash
if [ "$1" == "remove" ]
then
# echo "remove pl2303"
if [ "$(/sbin/lsmod |grep pl2303)" != "" ]
then
/sbin/rmmod pl2303
fi
elif [ "$1" == "update" ]
then
if [ "$(/sbin/lsmod |grep option)" != "" ]
then
/sbin/rmmod option
fi
if [ "$(/sbin/lsmod |grep pl2303)" != "" ]
then
/sbin/rmmod pl2303
fi
if [ "$(/sbin/lsmod |grep usbserial)" != "" ]
then
/sbin/rmmod usbserial
fi
/sbin/modprobe usbserial vendor=0x12d1 product=$2
else
# echo "modprobe usb-storage"
if [ "$(/sbin/lsmod |grep usb-storage)" == "" ]
then
/sbin/modprobe usb-storage
fi
fi
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.