Tiny Core Linux

General TC => General TC Talk => Topic started by: deodion on August 19, 2017, 08:11:03 PM

Title: Core 8.0 x64, file not found, but file exist
Post by: deodion on August 19, 2017, 08:11:03 PM
I have an enterprise application x64,

Tried to run it, but it returns something like this:
-sh splunk: file not found

I have read around, its says need to check with ldd and/or file command to find out missing libraries and it has something todo with 32/64 bit thing


I will try the command in few hours later,


Thank you
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: coreplayer2 on August 19, 2017, 08:25:13 PM
did you try just
Code: [Select]
splunk
or from the directory location of splunk
Code: [Select]
./splunk
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: coreplayer2 on August 19, 2017, 08:28:29 PM
Also, don't try to mix 64 bit applications in a 32bit environment, it will not work.

If you run the application as described in my last post it will almost always tell you which libraries are missing if any are missing..

Perhaps the application needs Bash?

Some x86_64 precompiled  programs (from another linux system) may require this symlink so it can find required libraries
Code: [Select]
ln -s /lib /lib64
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: coreplayer2 on August 19, 2017, 08:52:17 PM
I think you said new to linux??  ok some info for you regarding paths to a program.

Code: [Select]
echo $PATH  I'm sure I could explain this better; but entering this command will reveal all the locations where you can place a program and execute it simply by entering it's file name at the terminal.

Whereas
Code: [Select]
./program executes the program from the current directory
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: deodion on August 19, 2017, 09:33:02 PM
Tried ./splunk and splunk
Im aware about that,

Later I will try all other clues
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: deodion on August 20, 2017, 04:58:55 AM
Hello,

I use
Code: (bash) [Select]
ln -s /lib /lib64
Its working,


now I get: ps: invalid option -- 'p'
Code: (bash) [Select]
]ps: invalid option -- 'p'
BusyBox v1.25.1 (2017-03-14 16:33:32 UTC) multi-call binary.

Usage: ps [-o COL1,COL2=HEADER]

Show list of processes

        -o COL1,COL2=HEADER     Select columns for display
Done


Waiting for web server at http://127.0.0.1:8000 to be availableps: invalid option -- 'p'
BusyBox v1.25.1 (2017-03-14 16:33:32 UTC) multi-call binary.

Usage: ps [-o COL1,COL2=HEADER]

Show list of processes

        -o COL1,COL2=HEADER     Select columns for display
ps: invalid option -- 'p'
BusyBox v1.25.1 (2017-03-14 16:33:32 UTC) multi-call binary.

I can install and use BASH to solve this right?
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: Misalf on August 20, 2017, 05:07:06 AM
RE: ps: invalid option -- 'p'
I believe you need the full  procps.tcz .
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: deodion on August 20, 2017, 05:22:56 AM
After install procps.tcz

Its working but with flaw,
after start the program, it will start, but still showing ps: invalid option -- 'p'
and after that if execute another command, will show ps: invalid option -- 'p' again, and then the program will failed to run, leaving stale PID,

Code: (bash) [Select]
ps: invalid option -- 'p'
BusyBox v1.25.1 (2017-03-14 16:33:32 UTC) multi-call binary.

Usage: ps [-o COL1,COL2=HEADER]

Show list of processes

        -o COL1,COL2=HEADER     Select columns for display
Done



If you get stuck, we're here to help.
Look for answers here: http://docs.splunk.com

The Splunk web interface is at http://box:8000

tc@box:/mnt/sda1/tce/APPS/splunk/bin$ ./splunk status
ps: invalid option -- 'p'
BusyBox v1.25.1 (2017-03-14 16:33:32 UTC) multi-call binary.
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: andyj on August 20, 2017, 05:35:48 AM
Procps.tcz is a dependency of open-vm-tools.tcz, so if you are using open-vm-tools.tcz you would already have procps.tcz. But the problem here is probably that whatever is executing ps has the path hard coded to /bin/ps, which is the busybox version you see. You should either not use a path, or give the full path to the propcs version as /usr/local/bin/ps.
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: coreplayer2 on August 20, 2017, 07:58:42 AM
I can install and use BASH to solve this right?
If you're referring to the last error in your screenshot, then no..

ls /lib/lib64 is not a valid path, try this instead
Code: [Select]
ls /lib64
If you're referring to the first error in your screenshot, then most likely yes..
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: deodion on August 20, 2017, 09:22:59 AM
Procps.tcz is a dependency of open-vm-tools.tcz, so if you are using open-vm-tools.tcz you would already have procps.tcz. But the problem here is probably that whatever is executing ps has the path hard coded to /bin/ps, which is the busybox version you see. You should either not use a path, or give the full path to the propcs version as /usr/local/bin/ps.

Hopefully the adjustment work is not hard and a lot,
I see it in web GUI, while its on its very-very fast, I like it,

If procps is onboot.lst does that mean still not using /usr/local/bin/ps?
So I still have to adjust the PATH?
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: coreplayer2 on August 20, 2017, 09:52:47 AM
I can install and use BASH to solve this right?
If you're referring to the first error in your screenshot, then most likely yes..
A correction, try:
Code: [Select]
/opt/splunk/bin $ ./splunk start
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: Rich on August 20, 2017, 09:55:05 AM
Hi deodion
Do not adjust the path. If the application is calling  /bin/ps  then the application needs to be fixed. Do not make changes
to the  busybox  links in  /bin  as there may be system scripts that rely on the  busybox  version.
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: coreplayer2 on August 20, 2017, 10:19:45 AM
Code: [Select]
/opt/splunk/bin $ ./splunk start

Splunk> Australian for grep.

Checking prerequisites...
        Checking http port [8000]: open
        Checking mgmt port [8089]: open
        Checking appserver port [127.0.0.1:8065]: open
        Checking kvstore port [8191]: open
        Checking configuration...  Done.
        Checking critical directories...        Done
        Checking indexes...
                Validated: _audit _internal _introspection _telemetry _thefishbucket history main summary
        Done
        Checking filesystem compatibility...  Done
        Checking conf files for problems...
        Done
        Checking default conf files for edits...
        Validating installed files against hashes from '/opt/splunk/splunk-6.6.2-4b804538c686-linux-2.6-x86_64-manifest'
        All installed files intact.
        Done
All preliminary checks passed.

Starting splunk server daemon (splunkd)... 
Done


Waiting for web server at http://127.0.0.1:8000 to be available....... Done


If you get stuck, we're here to help. 
Look for answers here: http://docs.splunk.com

The Splunk web interface is at http://box:8000

/opt/splunk/bin $

I had to change permissions/ownership and as a quick test replaced the symlink to ps (which Rich specifically said don't do..) but for the test, splunk appears to work.  So maybe splunk needs fixing?

permissions/ownership changes not required, my bad.. :(
Code: [Select]
# export SPLUNK_HOME=/opt/splunk
# export PATH=$SPLUNK_HOME/bin:$PATH
was all that was needed..
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: coreplayer2 on August 20, 2017, 11:19:06 AM
OK deodion

This ps path issue is an easy fix.

Simply edit /opt/splunk/bin/pid_check.sh  to add /usr/local/bin: to this path variable

Code: [Select]
line 43: PATH=/usr/xpg4/bin:/usr/local/bin:/usr/bin:/bin
After loading procps.tcz splunk will look in /usr/local/bin for ps -p
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: deodion on August 20, 2017, 11:20:20 AM
Quote
permissions/ownership changes not required, my bad.. :(
Code: [Select]
# export SPLUNK_HOME=/opt/splunk
# export PATH=$SPLUNK_HOME/bin:$PATH
was all that was needed..

Firstly, from default installation, df -k shows I only get 323 MB for rootfs,
and I have the rest in /dev/sda1, so I was assuming this how things work, make the Core system lean and small,
and have others to put in /dev/sda1 instead,

tried to extract splunk to /opt, but it was out of space,

Quote
as a quick test replaced the symlink to ps (which Rich specifically said don't do..)

The export above seems doesnt contain about symlink change to ps, could you tell me how?
Any ps related should I work about?

Thank you very much,
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: deodion on August 20, 2017, 11:23:44 AM
OK deodion

This ps path issue is an easy fix.

Simply edit /opt/splunk/bin/pid_check.sh  to add /usr/local/bin: to this path variable

Code: [Select]
line 43: PATH=/usr/xpg4/bin:/usr/local/bin:/usr/bin:/bin
After loading procps.tcz splunk will look in /usr/local/bin for ps -p

thank you very much! I will try this later,
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: coreplayer2 on August 20, 2017, 11:29:44 AM
Code: [Select]
/opt/splunk/bin $ ./splunk start

Splunk> Australian for grep.

Checking prerequisites...
        Checking http port [8000]: open
        Checking mgmt port [8089]: open
        Checking appserver port [127.0.0.1:8065]: open
        Checking kvstore port [8191]: open
        Checking configuration...  Done.
        Checking critical directories...        Done
        Checking indexes...
                Validated: _audit _internal _introspection _telemetry _thefishbucket history main summary
        Done
        Checking filesystem compatibility...  Done
        Checking conf files for problems...
        Done
        Checking default conf files for edits...
        Validating installed files against hashes from '/opt/splunk/splunk-6.6.2-4b804538c686-linux-2.6-x86_64-manifest'
        All installed files intact.
        Done
All preliminary checks passed.

Starting splunk server daemon (splunkd)... 
Done


Waiting for web server at http://127.0.0.1:8000 to be available....... Done


If you get stuck, we're here to help. 
Look for answers here: http://docs.splunk.com

The Splunk web interface is at http://box:8000

/opt/splunk/bin $
Code: [Select]
/opt/splunk/bin $ splunk status
splunkd is running (PID: 7593).
splunk helpers are running (PIDs: 7594 7603 7713 7752).
/opt/splunk/bin $


Splunk web server and interface appears to be working fine now

Access  Splunk>Enterprise @
http://box:8000 (http://box:8000)
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: coreplayer2 on August 20, 2017, 12:10:41 PM
So to recap..

These commands are all I executed to get Splunk operational
Code: [Select]
tar xvzf splunk-6.6.2-4b804538c686-Linux-x86_64.tgz -C /opt

[ -e /lib64 ] || ln -s /lib /lib64

export SPLUNK_HOME=/opt/splunk
export PATH=$SPLUNK_HOME/bin:$PATH

sed -i 's|PATH=/usr/xpg4/bin:/usr/bin:/bin|PATH=/usr/xpg4/bin:/usr/local/bin:/usr/bin:/bin|' /opt/splunk/bin/pid_check.sh

tce-load -i procps

/opt/splunk/bin $ ./splunk start --accept-license

UPDATE:  I missed a command, but added now :)
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: deodion on August 21, 2017, 03:10:09 AM
Code: (bash) [Select]
[ -e /lib64 ] || ln -s /lib /lib64
btw, what is the meaning of the first command?
I can't find any explanation in google,
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: Misalf on August 21, 2017, 03:46:20 AM
It's an  IF  statement. The  -e  means it returns true if the given file/directory exists.
http://www.tldp.org/LDP/abs/html/fto.html
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: coreplayer2 on August 21, 2017, 07:04:10 AM
Code: [Select]
[ -e /lib64 ] || ln -s /lib /lib64
btw, what is the meaning of the first command?
I can't find any explanation in google,

Additionally, I read it like this: 
If the test command "[" /lib64 existence does not return true then execute "ln" command to create the symbolic link

BTW, you can create a shell script with those commands and run at boot to start the splunk server.  However, I'd test for the existence of /opt/splunk before executing tar..
Code: [Select]
[ -d /opt/splunk ] || tar xvzf /PathToArchive/splunk-6.6.2-4b804538c686-Linux-x86_64.tgz -C /opt
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: deodion on August 27, 2017, 06:09:07 AM
Quote
export SPLUNK_HOME=/opt/splunk
export PATH=$SPLUNK_HOME/bin:$PATH

I try to input export command above in bootlocal.sh, but it doesnt work?

I mean, if I echo $SPLUNK_HOME, its blank,
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: gerald_clark on August 27, 2017, 06:18:10 AM
Users do not inherit bootlocal.sh's environment.
Add it to /etc/profile or the users profile instead.
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: deodion on August 27, 2017, 06:49:45 AM
How should I put it in /etc/profile?

Can I simply insert the command?
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: Rich on August 27, 2017, 07:31:35 AM
Hi deodion
Add:
Code: [Select]
export SPLUNK_HOME=/opt/splunk
export PATH=$SPLUNK_HOME/bin:$PATH
to the end of  /etc/profile.  Add the line:
Code: [Select]
etc/profileto your  /opt/filetool.lst  file. Backup and reboot.
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: deodion on August 27, 2017, 09:09:22 AM
If I put it on bootlocal.sh like below,

### Load /etc/profile
cp /mnt/sda1/backupcfg/profile /etc/profile


I try it, but it seems doesnt work, why?

Im trying not to use filetool.lst as much as I can,
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: polikuo on August 27, 2017, 10:05:39 AM
If I put it on bootlocal.sh like below,

### Load /etc/profile
cp /mnt/sda1/backupcfg/profile /etc/profile


I try it, but it seems doesnt work, why?

Im trying not to use filetool.lst as much as I can,

bootlocal.sh is IN mydata.tgz
You need to backup, one way or another.
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: Rich on August 27, 2017, 10:44:52 AM
Hi deodion
Im trying not to use filetool.lst as much as I can,
In that case just add those two lines to   .profile  in your home directory instead.
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: deodion on August 27, 2017, 08:09:36 PM
Hello Rich,
I see it working with filetool.sh,

is this because with where filetool.sh is being executed before /etc/profile execution?
Title: Re: Core 8.0 x64, file not found, but file exist
Post by: gerald_clark on August 28, 2017, 08:22:07 PM
/etc/profile is not executed.
It is sourced by the shell when the shell starts ( after login ).