WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Correct (if possible) way to update a tcz without a reboot  (Read 4365 times)

Offline onelife

  • Full Member
  • ***
  • Posts: 141
Correct (if possible) way to update a tcz without a reboot
« on: July 29, 2017, 12:03:10 PM »
Greetings All,

I'm wondering if there is an conclusion on how a tcz should / could be updated without a reboot of the system?

The tcz I have in question is 100% "my own files" and would not have dependencies as such. It's actually a java application that I simply want to be able to update and remount without a reboot.

I see you can do commands such as :

Code: (bash) [Select]
sudo unmount -d /tmp/tcloop/package_name

But I see this doesn't actually take the loaded files off the mounted system?

I also see a few guys have made a tcz-reload / tcz-unload script but not sure if these are safe on Picore as 2 I tried didn't work and made the system unstable.

Any suggestions are awesome as I'd like to think this is possible and certainly like todo it the best way possible.

Many Thanks
Dean


Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: Correct (if possible) way to update a tcz without a reboot
« Reply #1 on: July 29, 2017, 12:52:13 PM »
If you loaded it as symlinks (mount mode), having the old symlinks there doesn't hurt anything, as long as the new extension is named the same.
The only barriers that can stop you are the ones you create yourself.

Offline onelife

  • Full Member
  • ***
  • Posts: 141
Re: Correct (if possible) way to update a tcz without a reboot
« Reply #2 on: July 29, 2017, 01:37:58 PM »
Thank you for that confirmation :)

So would the idea of doing :

Code: (bash) [Select]
sudo umount -d /tmp/tcloop/package_name
and then :

Code: (bash) [Select]
sudo mount /mnt/mmcblk0p2/tce/optional/package_name /tmp/tcloop/
Work all in order and would cause the remount to over right the files that are left behind from the umount?

The package paths etc are all identical, I simply update the package_name.tcz and would like to re-load this without a reboot.

It was originally mounted as part of TC boot / start process if that makes any difference?

Is that thinking then right?

THANK YOU! :)


Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: Correct (if possible) way to update a tcz without a reboot
« Reply #3 on: July 30, 2017, 04:10:29 AM »
Yes, that works fine. However, if the update added new files, you'd need to remove the installed marker (rm /usr/local/tce.installed/package_name) and use tce-load instead of mount.
The only barriers that can stop you are the ones you create yourself.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: Correct (if possible) way to update a tcz without a reboot
« Reply #4 on: July 30, 2017, 10:56:10 AM »
Hi onelife
Yes, that works fine. However, if the update added new files, you'd need to remove the installed marker (rm /usr/local/tce.installed/package_name) and use tce-load instead of mount.
If you do that and have a  PROGRAM.desktop  file with an icon listed, you'll first want to remove the three lines referring to your
program in  /usr/local/tce.icons  or you'll start seeing multiple icons on the wbar. I also used to remove the popup menu entry
under  /home/tc/.wmx/Applications  ,though I don't recall if that was necessary or me just being thorough.

When I was dealing with this I added commands to do the cleanup to the beginning of my build script.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: Correct (if possible) way to update a tcz without a reboot
« Reply #5 on: July 30, 2017, 01:47:34 PM »
Yep, lots of complications for a full unload. I assumed there was no icon or other bindings.
The only barriers that can stop you are the ones you create yourself.

Offline onelife

  • Full Member
  • ***
  • Posts: 141
Re: Correct (if possible) way to update a tcz without a reboot
« Reply #6 on: August 13, 2017, 05:58:06 AM »
Hi again all,

Seems I'm coming across a possible issue with this unmount and reload of tcz.

The issue however, only seems to be happening on older versions of TC.

On a system running TC version 6 the same unmount / load process that works on TC 8 doesn't work.

I get a "error" like this and I can't see what is causing it.

Code: [Select]
snb@snb:~$ sudo ./update_skynetwork/com/reboot.sh
umount: /tmp/tcloop/studio: filesystem was unmounted, but mount(8) failed: Invalid argument
/etc/sysconfig/tcedir/optional/studio.tcz: OK

The system doesn't reload the new tcz and uses the old although seems to load OK it says.

Any ideas?

THANK YOU!

Offline polikuo

  • Hero Member
  • *****
  • Posts: 758
Re: Correct (if possible) way to update a tcz without a reboot
« Reply #7 on: August 13, 2017, 08:10:37 AM »
Code: [Select]
snb@snb:~$ sudo ./update_skynetwork/com/reboot.sh
umount: /tmp/tcloop/studio: filesystem was unmounted, but mount(8) failed: Invalid argument
/etc/sysconfig/tcedir/optional/studio.tcz: OK
...
Any ideas?

What's the content of that script ?

Offline onelife

  • Full Member
  • ***
  • Posts: 141
Re: Correct (if possible) way to update a tcz without a reboot
« Reply #8 on: August 13, 2017, 09:39:08 AM »
Sorry, should have posted that too. It's basically this part :

Code: [Select]
sudo umount -d /tmp/tcloop/studio
sleep 1
sudo rm -f "/usr/local/tce.installed/studio"
sleep 1
sudo -u snb tce-load -i studio
sleep 1
$UPDATE/com/start.sh &

The start.sh script then starts our application etc.

Thank you!

Offline polikuo

  • Hero Member
  • *****
  • Posts: 758
Re: Correct (if possible) way to update a tcz without a reboot
« Reply #9 on: August 13, 2017, 10:46:42 AM »
Quote
sudo umount -d /tmp/tcloop/studio

Busybox umount does not have "-d" option

Code: [Select]
tc@box:~$ umount --help
BusyBox v1.26.2 (2017-05-05 04:20:53 UTC) multi-call binary.

Usage: umount [OPTIONS] FILESYSTEM|DIRECTORY

Unmount file systems

        -a      Unmount all file systems
        -r      Try to remount devices as read-only if mount is busy
        -l      Lazy umount (detach filesystem)
        -f      Force umount (i.e., unreachable NFS server)
        -D      Don't free loop device even if it has been used

Quote
sudo -u snb tce-load -i studio

I'd do
Code: [Select]
su tc -c 'tce-load -i studio'because this is what I get
Code: [Select]
tc@ox~$ sudo -u tc tce-load
Sorry, user tc is not allowed to execute '/usr/bin/tce-load' as tc on box.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: Correct (if possible) way to update a tcz without a reboot
« Reply #10 on: August 13, 2017, 10:51:27 AM »
Hi onelife
Quote
On a system running TC version 6 the same unmount / load process that works on TC 8 doesn't work.
Do you have  util-linux.tcz  installed? A Google search on that error turned up a  umount  bug in versions 2.25.1 and possibly
2.26 of  util-linux.tcz. See if this works any better:
Code: [Select]
sudo rm -f "/usr/local/tce.installed/studio"
sync
sudo busybox umount -d /tmp/tcloop/studio
sync
sudo -u snb tce-load -i studio
sleep 1
$UPDATE/com/start.sh &

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: Correct (if possible) way to update a tcz without a reboot
« Reply #11 on: August 13, 2017, 10:54:48 AM »
Hi polikuo
Quote
sudo umount -d /tmp/tcloop/studio

Busybox umount does not have "-d" option

Code: [Select]
tc@box:~$ umount --help
BusyBox v1.26.2 (2017-05-05 04:20:53 UTC) multi-call binary.

Usage: umount [OPTIONS] FILESYSTEM|DIRECTORY

Unmount file systems

        -a      Unmount all file systems
        -r      Try to remount devices as read-only if mount is busy
        -l      Lazy umount (detach filesystem)
        -f      Force umount (i.e., unreachable NFS server)
        -D      Don't free loop device even if it has been used
Actually, previous versions did have that option:
Code: [Select]
tc@box:~$ busybox umount --help
BusyBox v1.19.3 (2011-10-30 01:47:29 UTC) multi-call binary.

Usage: umount [OPTIONS] FILESYSTEM|DIRECTORY

Unmount file systems

        -a      Unmount all file systems
        -r      Try to remount devices as read-only if mount is busy
        -l      Lazy umount (detach filesystem)
        -f      Force umount (i.e., unreachable NFS server)
        -d      Free loop device if it has been used

tc@box:~$

Offline polikuo

  • Hero Member
  • *****
  • Posts: 758
Re: Correct (if possible) way to update a tcz without a reboot
« Reply #12 on: August 13, 2017, 11:09:51 AM »
Actually, previous versions did have that option:

Interesting ...
That explains why onelife's script performs differently between the two.
« Last Edit: August 13, 2017, 11:11:59 AM by polikuo »

Offline onelife

  • Full Member
  • ***
  • Posts: 141
Re: Correct (if possible) way to update a tcz without a reboot
« Reply #13 on: August 13, 2017, 12:30:29 PM »
Hi again,

Thank you so much for your help - However, interesting, busybox doesn't seem to have umount?

Code: [Select]
snb@snb:~$ sudo busybox umount -d /tmp/tcloop/studio
umount: applet not found

And according to busybox

Code: [Select]
snb@snb:~$ busybox
BusyBox v1.22.1 (2014-07-18 16:45:21 UTC) multi-call binary.
BusyBox is copyrighted by many authors between 1998-2012.
Licensed under GPLv2. See source distribution for detailed
copyright notices.

Usage: busybox [function [arguments]...]
   or: busybox --list[-full]
   or: busybox --install [-s] [DIR]
   or: function [arguments]...

BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable.  Most people will create a
link to busybox for each function they wish to use and BusyBox
will act like whatever it was invoked as.

Currently defined functions:
[, [[, addgroup, adduser, adjtimex, ar, arp, arping, ash, awk, basename, bunzip2, bzcat, bzip2, cal, cat, chgrp, chmod, chown, chpasswd, chroot, chrt, chvt,
cksum, clear, cmp, comm, cp, cpio, crond, cut, date, dc, dd, deallocvt, delgroup, deluser, depmod, df, diff, dirname, dmesg, dnsdomainname, dos2unix, du,
dumpkmap, dumpleases, echo, egrep, eject, env, ether-wake, expr, false, fbset, fdflush, fdformat, fdisk, fgconsole, fgrep, find, flock, fold, free, freeramdisk,
fsck, fstrim, ftpget, ftpput, fuser, getopt, getty, grep, gunzip, gzip, halt, hdparm, head, hexdump, hostid, hostname, hwclock, id, ifconfig, inetd, init,
insmod, install, ipcalc, ipcrm, ipcs, kill, killall, killall5, klogd, last, less, linux32, linux64, linuxrc, ln, loadfont, loadkmap, logger, logname, logread,
losetup, ls, lsmod, lsof, md5sum, mesg, microcom, mkdir, mkfifo, mknod, mkswap, mktemp, modinfo, modprobe, more, mv, nameif, nbd-client, nc, netstat, nice,
nohup, nslookup, ntpd, od, openvt, patch, pgrep, pidof, pivot_root, pkill, poweroff, printenv, printf, ps, pwd, rdate, readlink, realpath, reboot, renice,
reset, resize, rev, rm, rmdir, rmmod, route, rpm, rpm2cpio, script, sed, seq, setarch, setconsole, setkeycodes, setsid, sh, sha1sum, sleep, sort, split,
start-stop-daemon, strings, stty, sulogin, sum, swapoff, swapon, switch_root, sync, sysctl, syslogd, tail, tar, taskset, tee, telnet, test, tftp, tftpd, time,
timeout, top, touch, tr, true, tty, udhcpc, udhcpd, udpsvd, uname, uncompress, uniq, unix2dos, unxz, unzip, uptime, usleep, vconfig, vi, watch, wc, wget, which,
who, whoami, xargs, xz, xzcat, yes, zcat

Or am I missing something?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14847
Re: Correct (if possible) way to update a tcz without a reboot
« Reply #14 on: August 13, 2017, 12:33:55 PM »
Yes, busybox.suid