LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 10-09-2019, 10:28 AM   #1
finalturismo
Member
 
Registered: May 2019
Posts: 120

Rep: Reputation: Disabled
[Request] udev ACTION=="remove" NOT WORKING CORRECTLY , tried everything


Ok guys so i have been working on my drive wiper for a while now, i keep making progress and getting help. This on the other hand seems to be a nightmare. I cant for the life of me get udev remove action to work. I have no problem with the following


Code:
ACTION=="remove", KERNEL=="sdb", RUN+="/bin/udev_sdb_shred"




The remove rule seems simply just not be working correctly.
Code:
ACTION=="remove", KERNEL=="sdb", RUN+="/bin/udev_sdb_shred"
Code:
ACTION=="remove", ENV{DEVTYPE}=="disk", RUN+="/bin/udev_sdb_remove"


The idea is to put drives in the wiper and have them start wiping automatically with shred (Works great). if i come across a bad drive in the process , just pull it out.

I noticed on dmesg when i pull the drive it automatically kills /bin/udev_sdb_shred by default and times out. (This is great, but it does not kill the actual shred

process........) Just the script holding the shred process.

So i need either the remove feature of udev to be working correctly or the automatic kill feature of udev when a drive is pulled and stops responding to work.

code of /bin/udev_sdb_shred (auto killed by udev when drives no longer responses via I/O)
Code:
shred -v -f -z /dev/sdb   (not autokilled - actual code of udev_sdb_shred)

Any ideas guys, i got everything working even the auto upload log to my website.



This is literally my LAST hurdle before this project is completely finished.

Last edited by finalturismo; 10-09-2019 at 10:30 AM.
 
Old 10-10-2019, 06:48 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by finalturismo View Post
The remove rule seems simply just not be working correctly.
Code:
ACTION=="remove", KERNEL=="sdb", RUN+="/bin/udev_sdb_shred"
Code:
ACTION=="remove", ENV{DEVTYPE}=="disk", RUN+="/bin/udev_sdb_remove"
The first rule seems to run udev_sdb_shred when sdb is pulled out. This confuses me, because I would think that you want to stop shredding at this moment.
The second rule runs a different script udev_sdb_remove when any disk is pulled out.
Is my interpretation correct? Admittedly, I am not certain about the meaning of the KERNEL and ENV{DEVTYPE} attributes.

You say that it's not working correctly. Do you mean the scripts are not invoked?

Did you run udevadm monitor to see what udev events are actually generated, and what their attributes are?
 
  


Reply



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
[SOLVED] Every two minutes rsyslog outputs - rsyslogd: action 'action 3' resumed (module 'builtin:omfile') [v8.32.0 try http://www.rsyslog.com/e/2359 Toadman Linux - Software 9 09-01-2018 12:41 PM
php form action : second action ?? esteeven Programming 7 05-08-2015 08:06 AM
[SOLVED] ati 3d accelation not working on debian squeeze (tried everything on google) tuxxxxx Linux - Hardware 8 11-01-2010 07:28 AM
slackware-current, udev 0.96, and custom udev rules not working rignes Slackware 6 08-10-2006 03:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:47 PM.

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
Open Source Consulting | Domain Registration