What's new

Entware/Transmission on Merlin AsusWRT removes after reboot?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Niklas Nyberg

Occasional Visitor
Hi

I have an AC68U router (newly buyed) and installed Merlin AsusWRT on it. Im am trying to install, and keep, Entware/Transmission. The installation of Entware works fine (following the guide here https://github.com/RMerl/asuswrt-merlin/wiki/Entware), install Transmission and configure it and got everything working (from guide here: https://github.com/RMerl/asuswrt-merlin/wiki/Installing-Transmission-through-Entware)

But every time I reboot the router, everything disappears, Entware and Transmission.
Im guessing that it is installed wrong in some way but I cant figure out what I doing wrong.

Can anyone help me?

Best regards
Niklas
 
But every time I reboot the router, everything disappears, Entware and Transmission.
Im guessing that it is installed wrong in some way but I cant figure out what I doing wrong.
Hi Niklas,

Where and when do you start Entware after a reboot?
You need to put the command: /opt/etc/init.d/rc.unslung start into one of the user scripts - most likely it will be post-mount (to have your USB-drive mounted where Entware is installed).

Below the example of my post-mount script to start Entware after both USB devices (thumb drive and USB HDD) are mounted - regardless of the mount order (which can change after updating the firmware).

With kind regards
Joe :cool:

Code:
#!/bin/sh
# Logging of the script start
/usr/bin/logger -t START_$(basename $0) "started [$@]"
SCRLOG=/tmp/$(basename $0).log
touch $SCRLOG
NOW=$(date +"%Y-%m-%d %H:%M:%S")
echo $NOW "START_$(basename $0) started [$@]" >> $SCRLOG
#
# Executing the script commands
#
if [ $1 = "/tmp/mnt/usb-stick" ] # Replace the mountpoint with your one
then
ln -sf $1/entware.arm /tmp/opt >> $SCRLOG
if mount | grep /tmp/mnt/Data > /dev/null; then # Replace the mountpoint with your one - if you have 2 devices
/bin/sleep 2
/opt/etc/init.d/rc.unslung start >> $SCRLOG
else
echo "Data disk not mounted yet! Script: $0" >> $SCRLOG
fi
fi
#
if [ $1 = "/tmp/mnt/Data" ] # Replace the mountpoint with your one - if you have 2 devices
then
if mount | grep /tmp/mnt/usb-stick > /dev/null; # Replace the mountpoint with your one - if you have 2 devices
then
/bin/sleep 2
/opt/etc/init.d/rc.unslung start >> $SCRLOG
else
echo "USB stick not mounted yet! Script: $0" >> $SCRLOG
fi
fi
#
# Logging the finishing of the script
NOW=$(date +"%Y-%m-%d %H:%M:%S")
if [ "$?" -ne 0 ]
then
echo $NOW "Error in script  execution! Script: $0" >> $SCRLOG
else
echo $NOW "Script execution OK. Script: $0" >> $SCRLOG
fi
/usr/bin/logger -t STOP_$(basename $0) "return code $?"
exit $?
 
Hi Joe and thanks for your answer.
I dont know when Entware starts, I have just followed the guides above to install Entware and Transmission. My knowledge in Unix is ..... nothing :). I expected that it should work as long as I followed the guides.

I came from Padavans firmware to the Asus N56u router and everything worked "out of the box" as long as I did like the guide says.

How does the postmount work? Is it a script called from ....startupscripts??

Sorry about my lack of Unix knowlegde :-(

Regards
Niklas
 
Last edited:
It would probably be best to follow the installation steps again just to be sure that everything is in place where it should be.
 
JFFS enabled, reinstalled everyting. Didnt see after installation of Entware:
Info: Add '/opt/etc/init.d/rc.unslung start' to startup script for Entware.arm services to start

Looked at the guide again, below "The old way":

Now we have to configure Asuswrt to automatically stop/start services:

echo "#!/bin/sh" > /jffs/scripts/services-start
echo "sleep 20" >> /jffs/scripts/services-start
echo "/opt/etc/init.d/rc.unslung start" >> /jffs/scripts/services-start
echo "#!/bin/sh" > /jffs/scripts/services-stop
echo "/opt/etc/init.d/rc.unslung stop" >> /jffs/scripts/services-stop
chmod a+rx /jffs/scripts/*

Added this lines to the startup files and now everythinh works.

Thanks, people above
 
Info: Add '/opt/etc/init.d/rc.unslung start' to startup script for Entware.arm services to start
Hi,

As suggested by my posting above you should put the Entware start into the post-mount user script.
The reason is simple: Entware requires you to add a USB drive and you want to make sure that it's mounted before(!) you start Entware... :eek:

Below the current timing of my router startup:
Jan 1 01:00:50 START_services-start: started []
Jan 1 01:00:51 START_wan-start: started [0]
Jan 1 01:00:54 START_nat-start: started []
Jan 1 01:00:54 START_nat-start: started []
Jan 1 00:00:55 START_pre-mount: started [/dev/sdb1]
Jan 1 00:00:55 START_pre-mount: started [/dev/sda2]
Jan 1 01:00:55 START_firewall-start: started [eth0]
Jan 1 00:00:55 START_post-mount: started [/tmp/mnt/Data]
Jan 1 01:01:11 START_pre-mount: started [/dev/sdb5]
Jan 1 01:01:11 START_post-mount: started [/tmp/mnt/usb-stick]


As you can see the USB drive is mounted far later then the service-start script runs - of course you can use a long sleep command to overcome the issue, but you never know if the sleep is long enough... :rolleyes:

With kind regards
Joe :cool:

PS.: the service-stop script approach is fine and shows good practice in handling of start/stop scripts!
 
As suggested by my posting above you should put the Entware start into the post-mount user script.
The reason is simple: Entware requires you to add a USB drive and you want to make sure that it's mounted before(!) you start Entware

Putting into post-mount is the very right thing to do! To celebrate the joy, here is my post-mount. lol

Code:
#!/bin/sh

tag=$(basename $0)

logger -t $tag $1

if [ "$1" == "/tmp/mnt/sandisk" ]
then
    ## workaround firmware bug
    ## the bug: mount in mount_r() instead of mount_fstab()
    mount /tmp/mnt/sandisk -o remount,rw,nodev,noatime,barrier=1,data=writeback
   
    ## turn on swap file
    swapon /tmp/mnt/sandisk/swapfile

    ## link entware.arm to /opt
    ln -sf $1/entware.arm /tmp/opt

    /opt/etc/init.d/rc.unslung start
fi
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top