LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-06-2011, 01:10 PM   #1
jncunliffe
LQ Newbie
 
Registered: Jan 2011
Posts: 4

Rep: Reputation: 0
in with a parameter?


Hi,

Newbie to Linux so apologies if this is a daft one.

I'm following an article and need to create a link to file using:

Code:
ln -s /opt/bin/<your-drive> /opt/bin/usbhid-ups
Looking up what I need to enter for <your-drive> however I think the driver needs a parameter to work correctly i.e. 'megatec_usb ignoreoff'

Is passing this parameter as simple as:

Code:
ln -s /opt/bin/megatec_usb /opt/bin/usbhid-ups ignoreoff
If none of this makes sense, this http://forum.qnap.com/viewtopic.php?...=35970&start=0 is the article I'm trying to follow.

Thanks,

Jon C
 
Old 01-06-2011, 01:26 PM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Even having perused the forum/thread link you provided, I don't understand the piece about "ignoreoff", as I don't see a reference to it on that page.

Without the "ignoreoff", your `ln` command syntax is correct - can you please elaborate on exactly what you're trying to do here? What is the 'ignoreoff' thing supposed to do?

In short, `ln` works (as you have it correctly) like:

Code:
ln <some-existing-thing> <your-link-name>
of course with any --options added in there as required/desired.

Thanks & kind regards.
 
Old 01-06-2011, 01:39 PM   #3
jncunliffe
LQ Newbie
 
Registered: Jan 2011
Posts: 4

Original Poster
Rep: Reputation: 0
Hi,

Sorry, I should have explained further. The forum I'm looking at links to http://www.networkupstools.org/compat/stable.html where I have to look up the specific driver I need for my UPS. Most of the entries just refer to a straight forward driver name e.g. megatec. The one I need for my UPS says 'megatec_usb ignoreoff'.

The way I read this is that I need to make a link to the file 'megatec_usb' but I don't know how to force the 'ignoreoff' element through?

Thanks again,

Jon C
 
Old 01-06-2011, 01:50 PM   #4
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Hmmm..

I am not 100% sure yet, however it looks to me like you're wanting to make the symlink (using `ln` command) without any such parameter. Then, the parameter "ignoreoff" is supposed to go into some configuration file, rather than be used with `ln` command.

Look here:
Code:
To set the order in which your UPSes receive the shutdown commands, define
the "sdorder" value in your ups.conf.

	[bigone]
		driver = apcsmart
		port = /dev/ttyS0
		sdorder = 2

	[littleguy]
		driver = bestups
		port = /dev/ttyS1
		sdorder = 1

	[misc]
		driver = megatec
		port = /dev/ttyS2
		sdorder = 0
That's a snippet from:
http://www.networkupstools.org/doc/2.2.0/shutdown.html

... I speculate that the line I bolded above, would be an example of where you would put the "ignoreoff" parameter, after the driver name. It doesn't go with the `ln` command though.

The documentation seems to be ample, but so far I'm not finding it to be very intuitive... So, do you have a config file somewhere (maybe ups.conf?), that you need to put the driver name into, and perhaps set some other settings or parameters?
 
Old 01-06-2011, 02:04 PM   #5
jncunliffe
LQ Newbie
 
Registered: Jan 2011
Posts: 4

Original Poster
Rep: Reputation: 0
I'm glad it's not as easy as I thought, makes me feel a little less dumb...

My usb.conf looks like this:

Code:
[qnapups]
        driver = usbhid-ups
        port = auto
        mfr = "Plexus"
        model = "Plexus 500VA UPS"
        desc = "Workstation"
        pollinterval=1
As usbhid-ups has a link to my driver, megatec_usb, do you think changing usb.conf to this

Code:
[qnapups]
        driver = usbhid-ups ignoreoff
        port = auto
        mfr = "Plexus"
        model = "Plexus 500VA UPS"
        desc = "Workstation"
        pollinterval=1
would work....? Or possibly

Code:
[qnapups]
        driver = "usbhid-ups ignoreoff"
        port = auto
        mfr = "Plexus"
        model = "Plexus 500VA UPS"
        desc = "Workstation"
        pollinterval=1
...?
 
Old 01-06-2011, 02:40 PM   #6
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
My vote goes to the middle one of the three code blocks you posted above, the one without the quotes. However I'm not sure if the actual driver should be "usbhid-ups" or "megatec_usb" - I would try the latter first (as it is shown in post #4 in that example file).


Quote:
I'm glad it's not as easy as I thought, makes me feel a little less dumb...
Well, it isn't that it's not easy - merely that neither of us has configured one of these before and I for one have not read the entirety of the documentation; I expect that somewhere in the docs, there's a concise description of what's supposed to be done here -- and maybe not -- but if you can't find an exact reference, you'll need to test & experiment a little bit, or await someone who has configured the same software and thus has hands-on experience and been exactly where you are, before.

You'll get it sorted sooner than later I suspect.
Cheers!

EDIT - upon further thought, since you did make the symlink (yes?), I guess it would make sense to leave it like:
Code:
        driver = usbhid-ups ignoreoff

Last edited by GrapefruiTgirl; 01-06-2011 at 02:51 PM.
 
Old 01-06-2011, 05:23 PM   #7
jncunliffe
LQ Newbie
 
Registered: Jan 2011
Posts: 4

Original Poster
Rep: Reputation: 0
Well I've had a play and the conclusion I've come to is.... Ahhhhhhhh

I think I've got bigger problems than driver parameters. When I restarted my NAS to take all of the changes I had made the UPS process kept failing. Some simple investigation got me further along the way but now I've hit a wall and my head hurts. I think some questions back to the original forum perhaps.

Thanks very much for your help this evening though. As a minimum I've learned a few things which is always good....

Cheers,

Jon C
 
  


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
shell getopts: opt w/ optional parameter is taking next opt as its parameter! GrapefruiTgirl Programming 22 10-27-2010 07:00 AM
select first parameter RGummi Programming 4 09-06-2008 12:22 PM
linux bash - how to use a dynamic parameter in shell parameter expansion expression nickleus Linux - General 2 08-21-2006 05:54 AM
Which parameter to use...? FrogGuy Linux - Hardware 2 11-19-2005 09:25 PM
How to parameter gnomemeeting? Frederic45 Linux - Newbie 0 02-27-2005 05:51 AM


All times are GMT -5. The time now is 06:58 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration