LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-23-2017, 09:44 PM   #1
cyent
Member
 
Registered: Aug 2001
Location: ChristChurch New Zealand
Distribution: Ubuntu
Posts: 398

Rep: Reputation: 87
Invoking systemctl from udev rule?


So I have a slightly bizarre problem....

I have an openembedded linux setup.

Sometimes it will be on hardware that has a cellular USB modem installed on the PCB, and sometimes not.

I won't know before I boot.

So udev correctly sees the usb ID and I can create a udev rule to do...

Something.

That is the question. What something?

Ultimately I want to run up pppd and chatscript at the right point in the boot process.

So should I make the udev action something like
"systemctl enable pppd@ttyACM0.service"

Or should I just symbolic link in the .service file?

Suggestions?
 
Old 03-24-2017, 01:02 PM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
i don't see why it shouldn't work like that.
have you tried?

but i'm not sure if udev is the best tool; i think it's at its most useful when you un/plug devices during runtime, but in your case a systemd service running a script that checks for a condition(is that hardware present?) and then executes systemctl enable pppd@ttyACM0.service?
 
  


Reply

Tags
usb systemd udev



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
udev rule and xsane fynstee Linux - Newbie 2 12-15-2009 11:12 AM
First UDEV Rule, Not quite there ... orbit Slackware 7 02-22-2009 10:08 PM
udev rule: need help DPenguin Linux - Hardware 0 08-04-2008 07:29 PM
Udev Rule Help Please Toods Slackware 1 11-23-2007 08:55 AM
need help with udev rule hussam Linux - Software 2 12-05-2006 03:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:20 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
Open Source Consulting | Domain Registration