Make appear a file in /opt to be in /usr/sbin


Forum: Other Help Topics
Topic: Make appear a file in /opt to be in /usr/sbin
started by: magicpio

Posted by magicpio on Sep. 25 2005,19:43
Hi,

I have an executable in /opt, e.g. /opt/exec1
But some other program need it to be in /usr/sbin, which is write protected.

How can I make /opt/exec1 to appear to be /usr/sbin/exec1 WITHOUT
loading a small *.dsl extension or
add write to the bootparameters ( ie dsl write ) or
call  /etc/init.d/mkwriteable in /opt/bootlocal.sh or
remaster the KNOPPIX file using 'mkwriteable'?

E.g. using  ln ?

Thanks
magicpio

Posted by ke4nt1 on Sep. 25 2005,19:58
It depends on WHY you , or it, wants it to be seen in /usr/sbin.

If you are looking for it to be in your default path, like it would be
if it WAS in /usr/bin, you can add that location to your PATH.

If some function of the program, say some support files,
really NEED to see the exec located in /usr/sbin, then you could
recompile the program, to work from the /opt/exec1 directory,
rather than the default /usr/sbin it was compiled to work from originally.

We would need more details about the app, to suggest to you the use
of a wrapper, or other means, to have other support files follow a
particular path or location. ( libs, etc.. )

If this is an extension you want to load , or install, and have
it automatically run with all support files found by the app,
recompiling it is the best method, combined with a wrapper,
to link back into the filesystem for other lib/file support
already present in the distro.

73
ke4nt

Posted by magicpio on Sep. 26 2005,20:14
I could possibly get the source of the app, but recompiling can be quite a big effort as well.

It´s ddclient btw. (dynamic dns client), and it looks in the path for its config file. But itself seems to need itself in /usr/sbin, at least I did not find any option to change this.

However, I´ve used mkwriteable just to try, whether that works, and - yes, it starts, but then fails for some perl module it doesn´t find.

But generally speaking, you sound as if there is no other easy solution to my original question?!

Posted by NotTheMama on Sep. 27 2005,06:49
Can you use symbolic links?
Something like "ln -s /opt/exec1 /usr/sbin/exec1" as root.
This could be written in /opt/bootlocal.sh

"Write protected" even for root? Even if this is frugal all the files in /usr/sbin are symbolic links to something like /KNOPPIX/usr/sbin/<program>.
If you are trying to overwrite a file, you have to remove the links first ( If it is a link) and then you can make de symbolic link...

HTH.,

Remco

Posted by mikshaw on Sep. 27 2005,14:31
If you haven't run mkwriteable, the sbin directory itself is a symlink, so you can't add to it (not positive about that, but pretty sure).

There's a good possibility that if it can't find a specific perl module, then that module isn't in DSL

Posted by magicpio on Sep. 27 2005,20:44
I tried ln , but that doesn´t work.
I agree with mikshaw on the symlink behaviour.

As for perl, that seems to be the problem. It is looking for:
Can't locate Sys/Hostname.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.0 /usr/local/share/perl/5.8.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8.0 /usr/share/perl/5.8.0 /usr/local/lib/site_perl .) at ./ddclient line 14.
BEGIN failed--compilation aborted at ./ddclient line 14.


Btw. ddclient itself is no executable (shame on me), it is a 95k perl script!
I´ve tried to find out, why it wants to be located in /usr/sbin , but my perl knowledge is close to 0 in first approximation  :p


Will now try some other dyn dns clients, maybe a neat little ansi-C binary, which doesn´t require any scripting language at all ....

Posted by magicpio on Dec. 18 2005,10:08
Just to give a feedback on my finally succsessfully approach:
I'm using INADYN now, freeware from < http://inadyn.ina-tech.net/ >  .

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.