WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: TCE Persistence; Why can't I find my apps after booting  (Read 5514 times)

Offline Adam

  • Full Member
  • ***
  • Posts: 121
TCE Persistence; Why can't I find my apps after booting
« on: June 17, 2017, 12:13:30 AM »
I've been reading this article, but still not sure about this situation.

Persistence for Dummies, or "Why can't I find my apps and settings after booting?"
http://wiki.tinycorelinux.net/wiki:persistence_for_dummies

Since HAproxy is not available on TCL 7.2, I've downloaded it manually from TCL 8 repo.
Code: [Select]
wget http://tinycorelinux.net/8.x/x86/tcz/haproxy.tcz
I've no issue with other apps such as tcpdump.

This is the comparison between tcpdump and haproxy.

Quote
user@box:~$ sudo slocate tcpdump
/mnt/sda1/tce/optional/tcpdump.tcz.dep
/mnt/sda1/tce/optional/tcpdump.tcz.md5.txt
/mnt/sda1/tce/optional/tcpdump.tcz
/usr/local/sbin/tcpdump.4.4.0
/usr/local/sbin/tcpdump
/usr/local/share/licences/tcpdump
/usr/local/share/licences/tcpdump/LICENSE
/usr/local/tce.installed/tcpdump
user@box:~$

user@box:~$ sudo slocate haproxy
/home/user/haproxy.tcz
/usr/local/sbin/haproxy
/usr/local/share/man/man1/haproxy.1
/usr/local/tce.installed/haproxy
user@box:~$

user@box:~$ ls -lah /mnt/sda1/tce/optional/ | egrep 'haproxy|tcpdump'
-rw-rw-r--    1 1001     staff     272.0K Jun 12 16:28 tcpdump.tcz
-rw-rw-r--    1 1001     staff         24 Jun 12 16:27 tcpdump.tcz.dep
-rw-rw-r--    1 1001     staff         46 Jun 12 16:28 tcpdump.tcz.md5.txt
user@box:~$

user@box:~$ ls -lah /usr/local/sbin/ | egrep 'haproxy|tcpdump'
lrwxrwxrwx    1 root     root          42 Jun 17 11:48 haproxy -> /tmp/tcloop/haproxy/usr/local/sbin/haproxy
lrwxrwxrwx    1 root     root          42 Jun 17 11:43 tcpdump -> /tmp/tcloop/tcpdump/usr/local/sbin/tcpdump
lrwxrwxrwx    1 root     root          48 Jun 17 11:43 tcpdump.4.4.0 -> /tmp/tcloop/tcpdump/usr/local/sbin/tcpdump.4.4.0
user@box:~$

user@box:~$ ls -lah /usr/local/share/licences/ | egrep 'haproxy|tcpdump'
drwxr-xr-x    2 root     root          60 Jun 18  2013 tcpdump/
user@box:~$

user@box:~$ ls -lah /usr/local/tce.installed/ | egrep 'haproxy|tcpdump'
-rw-r--r--    1 user     staff          0 Jun 17 11:48 haproxy
-rw-r--r--    1 1001     staff          0 Jun 17 11:43 tcpdump
user@box:~$

I notice that haproxy is not in /mnt/sda1/tce/optional/ directory as I downloaded it manually using wget to home directory. However, even if move haproxy.tcz to /mnt/sda1/tce/optional/, it still doesn't change anything.

I still can't make haproxy persistence even though it has already been listed in onboot.lst

Quote
user@box:~$ grep haproxy /mnt/sda1/tce/onboot.lst
haproxy.tcz
user@box:~$

Your advise in this matter would be highly appreciated. Thanks

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: TCE Persistence; Why can't I find my apps after booting
« Reply #1 on: June 17, 2017, 06:50:09 AM »
onboot.lst  doesn't provide any persistence features. It just lists what shall be loaded when booting.

If you move your custom extension to the tce/optional directory, I can imagine only one situation where your custom extension would be gone after reboot. That would be the Cloud-Mode, where extensions are downloaded to a tce directory in /tmp, because, for example, the tce-dir wasn't found at boot.
Run
Code: [Select]
readlink /etc/sysconfig/tcedir
To find out if that's the case.
Download a copy and keep it handy: Core book ;)

Offline Adam

  • Full Member
  • ***
  • Posts: 121
Re: TCE Persistence; Why can't I find my apps after booting
« Reply #2 on: June 25, 2017, 10:56:29 AM »
onboot.lst  doesn't provide any persistence features. It just lists what shall be loaded when booting.
Noted with thanks  :)

If you move your custom extension to the tce/optional directory, I can imagine only one situation where your custom extension would be gone after reboot.
Exactly

That would be the Cloud-Mode, where extensions are downloaded to a tce directory in /tmp, because, for example, the tce-dir wasn't found at boot.
Noted

Run
Code: [Select]
readlink /etc/sysconfig/tcedir
To find out if that's the case.
See the output below

Code: [Select]
tc@box:~$ readlink /etc/sysconfig/tcedir
/mnt/sda1/tce
tc@box:~$

Installation Process: Before & After
Code: [Select]
tc@box:~$ haproxy
-bash: haproxy: command not found
tc@box:~$
tc@box:~$ tce-load -i haproxy.tcz
haproxy.tcz: OK
tc@box:~$ haproxy
HA-Proxy version 1.3.21 2009/10/12
Copyright 2000-2009 Willy Tarreau <w@1wt.eu>

Usage : haproxy [-f <cfgfile>]* [ -vdVD ] [ -n <maxconn> ] [ -N <maxpconn> ]
        [ -p <pidfile> ] [ -m <max megs> ]
        -v displays version ; -vv shows known build options.
        -d enters debug mode ; -db only disables background mode.
        -V enters verbose mode (disables quiet mode)
        -D goes daemon
        -q quiet mode : don't display messages
        -c check mode : only check config files and exit
        -n sets the maximum total # of connections (2000)
        -m limits the usable amount of memory (in MB)
        -N sets the default, per-proxy maximum # of connections (2000)
        -p writes pids of all children to this file
        -de disables epoll() usage even when available
        -ds disables speculative epoll() usage even when available
        -dp disables poll() usage even when available
        -sf/-st [pid ]* finishes/terminates old pids. Must be last arguments.

tc@box:~$

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: TCE Persistence; Why can't I find my apps after booting
« Reply #3 on: June 25, 2017, 12:21:18 PM »
So the extension is actually there but just not loaded.

If you still have it in your user's home directory, it will be loaded from there if you issue the  tce-load  command while in your user's home directory. It won't be found while booting.

If you have copied it to  /mnt/sda1/tce/optional  and removed it from your user's home directory, it will be loaded from the intended extension storage and it will be found at boot.

Maybe you made a typo in your onboot.lst file.
Also note the last line must be blank.
Download a copy and keep it handy: Core book ;)

Offline Adam

  • Full Member
  • ***
  • Posts: 121
Re: TCE Persistence; Why can't I find my apps after booting
« Reply #4 on: June 26, 2017, 12:38:40 AM »
So the extension is actually there but just not loaded.
That's right. I've to manually run tce-load -i haproxy.tcz if I need to run the app.

If you still have it in your user's home directory, it will be loaded from there if you issue the  tce-load  command while in your user's home directory. It won't be found while booting.

If you have copied it to  /mnt/sda1/tce/optional  and removed it from your user's home directory, it will be loaded from the intended extension storage and it will be found at boot.

Maybe you made a typo in your onboot.lst file.
Also note the last line must be blank.

BEFORE REBOOT
1. I've moved haproxy.tcz from home to /mnt/sda1/tce/optional/ directory
2. There is no space in onboot.lst.
Quote
tc@box:~[08:28:12]$ haproxy
-bash: haproxy: command not found
tc@box:~[08:28:13]$
tc@box:~[08:28:14]$ sudo slocate haproxy
/mnt/sda1/tce/optional/haproxy.tcz
tc@box:~[08:28:17]$
tc@box:~[08:28:19]$ cat /mnt/sda1/tce/onboot.lst
openssh.tcz
file.tcz
slocate.tcz
tzdata.tcz
curl.tcz
lynx.tcz
apache2-mod-php5.tcz
mariadb-client.tcz
mariadb.tcz
bash.tcz
php5.tcz
tcpdump.tcz
nmap.tcz
python3.5.tcz
hping3.tcz
iptables.tcz
haproxy.tcz
tc@box:~[08:28:23]$ tce-load -i haproxy
/usr/bin/tce-load: line 212: can't create /tmp/appserr: Permission denied
haproxy.tcz: OK
tc@box:~[08:28:42]$
tc@box:~[08:28:48]$ haproxy -v
HA-Proxy version 1.3.21 2009/10/12
Copyright 2000-2009 Willy Tarreau <w@1wt.eu>

tc@box:~[08:28:52]$

AFTER REBOOT
Weird, I did the same steps before but it didn't work.
Somehow it's working this time  :)
Quote
tc@box:~$ uptime; haproxy -v
 12:37:06 up 0 min,  2 users,  load average: 0.16, 0.03, 0.01
HA-Proxy version 1.3.21 2009/10/12
Copyright 2000-2009 Willy Tarreau <w@1wt.eu>

tc@box:~$

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: TCE Persistence; Why can't I find my apps after booting
« Reply #5 on: June 26, 2017, 02:03:14 PM »
Hello Adam,

Please show output of
Code: [Select]
showbootcodes