LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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



Reply
 
Search this Thread
Old 05-19-2010, 10:31 AM   #1
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,688

Rep: Reputation: Disabled
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?

Last edited by JZL240I-U; 05-19-2010 at 10:32 AM.
 
Old 05-20-2010, 02:53 AM   #2
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 669

Rep: Reputation: 134Reputation: 134
Quote:
Originally Posted by JZL240I-U View Post
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?
Create script /sbin/usbmod:
Code:
#!/bin/sh
echo $PPID >> /tmp/usbmod_caller
 
1 members found this post helpful.
Old 05-20-2010, 03:49 PM   #3
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 1,554

Rep: Reputation: 241Reputation: 241Reputation: 241
ps -Al

(when it's running)

otherwise the long and slow way...

$ egrep -r -i "usbmod" /etc/*

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.)
 
Old 05-21-2010, 02:46 AM   #4
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,688

Original Poster
Rep: Reputation: Disabled
@ 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

Last edited by JZL240I-U; 05-21-2010 at 02:51 AM.
 
Old 06-01-2010, 07:42 AM   #5
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,688

Original Poster
Rep: Reputation: Disabled
Well, HWActivator is not needed (anymore, at least not when running SuSE 11.2). Thanks every one for helping.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
a script calls another script which calls "bash" inside lordofring Linux - Software 10 03-18-2010 10:59 AM
Finding the Process ID of a Process While Initiating the Process senthilmuthiah Linux - Newbie 7 04-02-2009 11:37 AM
process ,threads and system calls raedbenz Linux - Newbie 16 07-15-2008 01:30 AM
Please a script/program that logs all the IP addresses of SKYPE phone calls ? frenchn00b Programming 4 02-12-2008 05:40 PM
Which script calls the X11 program on RedHat 8.0? yorambaron Linux - Software 2 12-13-2003 09:46 AM


All times are GMT -5. The time now is 03:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration