VectorLinux

Please login or register.

Login with username, password and session length
Advanced search  

News:

Visit our home page for VL info. For support and documentation, visit the Vector Linux Knowledge Center or search the Knowledge Center and this Forum using the search box above.

Author Topic: how to correctly load a daemon at boot as root?(solved)  (Read 1486 times)

danthemannewtolinux

  • Vectorite
  • ***
  • Posts: 107
how to correctly load a daemon at boot as root?(solved)
« on: March 15, 2012, 09:54:35 pm »

hi there, i'm trying to correctly load a daemon at boot to make a program run that works when i run it in command as root but not a regular user other than adding it to my rc.local file....i tried that and i get a display error and when i add the & for it to run in background, I boot to desktop but the said program does not work until i open terminal and su then run the command. I also tried adding it to my startup application after boot and that doesn't work either.  I'm kinda getting annoyed and confused. Can someone help me with this?
« Last Edit: March 19, 2012, 11:16:37 am by danthemannewtolinux »
Logged

bigpaws

  • Vectorian
  • ****
  • Posts: 1869
Re: how to correctly load a daemon at boot as root?
« Reply #1 on: March 15, 2012, 10:54:46 pm »

You may need to add the full path to the script that
you wish to run.  example /usr/bin/bash/startme

Root has a different path vs a normal user.

You can see that by using this command:

echo $PATH

as root and normal user and you will see the difference.

This may help:

http://www.linfo.org/path_env_var.html

If you give exact details then an exact command could be
given for you to run under /etc/rc.d/rc.local

Bigpaws
Logged

danthemannewtolinux

  • Vectorite
  • ***
  • Posts: 107
Re: how to correctly load a daemon at boot as root?
« Reply #2 on: March 16, 2012, 06:28:42 am »

ok the exact details of the program i want to run are as follows:

the executable file and all other files for the program are in this folder : /home/daniel/sonypid-1.91/
and the executable i need to run as root is sonypid, so....
in my rc.local file would i add this:

sonypid PATH=$PATH: /home/daniel/sonypid-1.91/

or would i add

PATH=$PATH: /home/daniel/sonypid-1.91/sonypid

?? Sorry to be such a bug, but this is drivin me nuts, i've been trying to get this program to load at boot for 2 weeks now.  Thanks for the help so far by the way. ;D
Logged

Daniel

  • Packager
  • Vectorian
  • ****
  • Posts: 704
    • TuxToys - Packages for VectorLinux 6.0
Re: how to correctly load a daemon at boot as root?
« Reply #3 on: March 16, 2012, 07:39:51 am »

Actually it should just be:

Code: [Select]
/home/daniel/sonypid-1.91/sonypid

No $PATH variable needed.
Logged
The following sentence is true. The previous sentence is false.

VL 6.0 SOHO KDE-Classic on 2.3 Ghz Dual-core AMD with 3 Gigs of RAM

danthemannewtolinux

  • Vectorite
  • ***
  • Posts: 107
Re: how to correctly load a daemon at boot as root?
« Reply #4 on: March 16, 2012, 10:20:38 am »

ok, i did that and then the computer boots only until it tries to load that daemon and says it loaded the daemon but then says, failed to open display and doesn't continue to boot although the scroll works but it doesn't boot any further, so i had to use my live cd and get back into terminal and remove that line, i tried with the & symbol and it says it loaded the daemon at reboot but doesn't work on desktop and i noticed when i rebooted it was running in the background if you know what i mean, like black screen said event pressed for the scroll button i'm trying to load before actually completing the reboot.
Logged

bigpaws

  • Vectorian
  • ****
  • Posts: 1869
Re: how to correctly load a daemon at boot as root?
« Reply #5 on: March 16, 2012, 04:23:23 pm »

Are we to guess that you have a Sony Vaio laptop
and you are trying to key fnkeys or brighitness to work?

The sonypid module is in the linux kernel. All you may need
to do is load the kernel module. The other problem  is that
you may have a conflicting module that may need to be blacklisted.

Did you look at lsmod to see what modules were loaded?

When you say exact details the expectation would be something in this order.

I have a Sony Vaio laptop model number. The function keys do not work even
after trying to load the kernel module.

I followed this sites information:

http://www.popies.net/sonypi/index.html

I downloaded the sonypid file. I did not try the  spicctrl file.

After downloading and extracting the file. I followed the compile instructions and
I was not able to get it to work.

With the example above the there is enough information to start asking questions.

When questions are asked without alot of information then it is more of a
guessing game about the real problem.

After looking at the file it would appear that if you ran the Makefile
that the path your are trying to use is wrong. If you compiled the
program you should find the path to be:

/usr/sbin/sonypid

If you run that command as root you should then see the module being loaded.

My comments are not meant to inflame but to teach the better way to ask for
help.

Bigpaws
Logged

danthemannewtolinux

  • Vectorite
  • ***
  • Posts: 107
Re: how to correctly load a daemon at boot as root?
« Reply #6 on: March 17, 2012, 07:44:34 pm »

ok, thanks for the tip..i'm quite new to linux so i really don't know the proper ways to ask questions yet, i guess i should've did a bit more research on how to ask questions before just leaping in to trying to get help when i don't have a clue what i'm doing in the first place. lol. Anyway, thanks for your help bigpaws.
Still loving the vector distro though but getting flustered at the same time.. :P
« Last Edit: March 17, 2012, 07:53:28 pm by danthemannewtolinux »
Logged

bigpaws

  • Vectorian
  • ****
  • Posts: 1869
Re: how to correctly load a daemon at boot as root?
« Reply #7 on: March 17, 2012, 11:11:45 pm »

Linux can be frustrating when moving from Windows.

The number one thing to remember is Linux is not Windows.

There are not many things that are the same. The Linux
kernel has most of the modules (drivers in the Windows world).

Your knowledge will increase in time.

Bigpaws
Logged

danthemannewtolinux

  • Vectorite
  • ***
  • Posts: 107
Re: how to correctly load a daemon at boot as root?(solved)
« Reply #8 on: March 19, 2012, 11:17:15 am »

solved used synclient instead of sonypid
Logged