What's new

Asus AC-56U post-mount startup script not working

  • 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!

tiskora

Occasional Visitor
I added
post-mount to /jffs/scripts/post-mount
chmod a+rx /jffs/scripts/post-mount

admin:# cat /jffs/scripts/post-mount
#!/bin/sh
LD_LIBRARY_PATH=/opt/lib /opt/bin/svnserve -d -r /tmp/mnt/sda1/repo


when I run the script manually with sh post-mount it works, but when I restart the router svnserve didn't start automatically.

Any ideas ?
 
I added
post-mount to /jffs/scripts/post-mount
chmod a+rx /jffs/scripts/post-mount

admin:# cat /jffs/scripts/post-mount
#!/bin/sh
LD_LIBRARY_PATH=/opt/lib /opt/bin/svnserve -d -r /tmp/mnt/sda1/repo


when I run the script manually with sh post-mount it works, but when I restart the router svnserve didn't start automatically.

Any ideas ?

You know that your script will be executed after every 'mount' ? You have one disk ? Anything in the loggs? You could also add a line to the script, just to make sure it runs: touch /tmp/postmount.txt
If the script is processed, there will be a file postmount.txt in /tmp

Please tell us a little bit more about the environment and what you want to do.
 
Better way to do "touch /tmp/postmount.txt" which writes in /tmp
Is to add: "logger -t $(basename $0) "Postmount: Started" or which text you want and that writes in logfile.

Octopus
 
I added
post-mount to /jffs/scripts/post-mount
chmod a+rx /jffs/scripts/post-mount

admin:# cat /jffs/scripts/post-mount
#!/bin/sh
LD_LIBRARY_PATH=/opt/lib /opt/bin/svnserve -d -r /tmp/mnt/sda1/repo


when I run the script manually with sh post-mount it works, but when I restart the router svnserve didn't start automatically.

Any ideas ?

I have the same issue with post-mount script and I discovered that will be executed but with 5-6 minutes delay, just check yours. Dunno since witch firmware version I get this :(
 
I edited /jffs/scripts/post-mount like this:
logger -t $(basename $0) "Postmount: Started"
touch /tmp/postmount.txt
LD_LIBRARY_PATH=/opt/lib /opt/bin/svnserve -d -r /tmp/mnt/sda1/repo
logger -t $(basename $0) "Postmount: Started AFTER SVN"

chmod a+rx /jffs/scripts/firewall-start

when I run it manually it writes in the System log and creates /tmp/postmount.txt but when I restart it nothing happens...

Thank you for helping me.
 
I waited 15 minutes and it still not executed the scripts
Uptime 0 days 0 hours 15 minutes 31 seconds

I there another way to start the svn server?

Here are the las lines from the System log
Jan 22 21:49:26 admin: sh /opt/S50asuslighttpd.1 start
Jan 22 21:49:31 admin: sh /opt/S50downloadmaster.1 start
Jan 22 21:49:31 rc_service: hotplug 805:notify_rc restart_nasapps
Jan 22 21:49:31 iTunes: daemon is stopped
Jan 22 21:49:32 FTP Server: daemon is stopped
Jan 22 21:49:32 Samba Server: smb daemon is stopped
Jan 22 21:49:33 kernel: gro disabled
Jan 22 21:49:33 Timemachine: daemon is stopped
Jan 22 21:49:44 crond[589]: time disparity of 2135329 minutes detected
Jan 22 21:49:52 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1ae8 because the filename was not found in its parent directory index. Directory inode 0x1a6e is corrupt. Run chkdsk.
Jan 22 21:49:52 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1aea because the filename was not found in its parent directory index. Directory inode 0x1a6e is corrupt. Run chkdsk.
Jan 22 21:49:52 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1ae9 because the filename was not found in its parent directory index. Directory inode 0x51 is corrupt. Run chkdsk.
Jan 22 21:49:52 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1ae9 because the filename was not found in its parent directory index. Directory inode 0x1a6e is corrupt. Run chkdsk.
Jan 22 21:49:52 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1aeb because the filename was not found in its parent directory index. Directory inode 0x1a6e is corrupt. Run chkdsk.
Jan 22 21:49:53 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1c5c because the filename was not found in its parent directory index. Directory inode 0x51 is corrupt. Run chkdsk.
Jan 22 21:50:14 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1b64 because the filename was not found in its parent directory index. Directory inode 0x1a6e is corrupt. Run chkdsk.
Jan 22 21:50:14 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1b64 because the filename was not found in its parent directory index. Directory inode 0x1a6e is corrupt. Run chkdsk.
Jan 22 21:50:14 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1b64 because the filename was not found in its parent directory index. Directory inode 0x1a6e is corrupt. Run chkdsk.
Jan 22 21:50:15 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1cd8 because the filename was not found in its parent directory index. Directory inode 0x88 is corrupt. Run chkdsk.
Jan 22 21:50:15 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1cd5 because the filename was not found in its parent directory index. Directory inode 0x88 is corrupt. Run chkdsk.
Jan 22 21:50:15 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1cd5 because the filename was not found in its parent directory index. Directory inode 0x88 is corrupt. Run chkdsk.
Jan 22 21:50:15 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1cd5 because the filename was not found in its parent directory index. Directory inode 0x88 is corrupt. Run chkdsk.
Jan 22 21:50:15 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1cd5 because the filename was not found in its parent directory index. Directory inode 0x88 is corrupt. Run chkdsk.
Jan 22 21:50:15 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1cdc because the filename was not found in its parent directory index. Directory inode 0x88 is corrupt. Run chkdsk.
Jan 22 21:50:15 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1cdc because the filename was not found in its parent directory index. Directory inode 0x88 is corrupt. Run chkdsk.
Jan 22 21:50:25 kernel: __ntfs_error: 1 callbacks suppressed
Jan 22 21:50:25 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1ceb because the filename was not found in its parent directory index. Directory inode 0x1a62 is corrupt. Run chkdsk.
Jan 22 21:50:25 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1ceb because the filename was not found in its parent directory index. Directory inode 0x1a62 is corrupt. Run chkdsk.
Jan 22 21:50:25 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1ceb because the filename was not found in its parent directory index. Directory inode 0x1a62 is corrupt. Run chkdsk.
Jan 22 21:50:25 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1ceb because the filename was not found in its parent directory index. Directory inode 0x1a62 is corrupt. Run chkdsk.
Jan 22 21:50:25 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1cf3 because the filename was not found in its parent directory index. Directory inode 0x1a62 is corrupt. Run chkdsk.
Jan 22 21:50:25 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1cf3 because the filename was not found in its parent directory index. Directory inode 0x1a62 is corrupt. Run chkdsk.
Jan 22 21:50:25 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1cf3 because the filename was not found in its parent directory index. Directory inode 0x1a62 is corrupt. Run chkdsk.
Jan 22 21:50:25 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1cf3 because the filename was not found in its parent directory index. Directory inode 0x1a62 is corrupt. Run chkdsk.
Jan 22 21:50:25 kernel: tntfs error (device sda1, pid 842): ntfs_write_inode(): Failed to update a directory index entry of inode 0x1c6e because the filename was not found in its parent directory index. Directory inode 0x1a62 is corrupt. Run chkdsk.
Jan 22 21:50:37 kernel: warning: `vsftpd' uses 32-bit capabilities (legacy support in use)
 
chmod a+rx /jffs/scripts/firewall-start

when I run it manually it writes in the System log and creates /tmp/postmount.txt but when I restart it nothing happens...

Thank you for helping me.

advice : when run run chmod in this specific context, do:
chmod a+rx/jffs/scripts/*
to prevent errors in naming the script.

Also, as said by TeHashX, sometimes it takes a few minutes before the mounting is done. Why ? Because there is some healthy checking made on the disk before mounting it. It could even take more than 30 minutes. That's why I was asking for more details...
What is that disk ? How many partitions? NTFS, ext?

EDIT: In this case, the script was not executed because the disk was not (still) mounted

If it is the case, you will see it on the web gui home page. Please report back.
 
Last edited:
Disk info

One HDD, one partition, NTFS on USB 3.0 port.


admin:/jffs/scripts# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 19.3M 19.3M 0 100% /
devtmpfs 124.8M 0 124.8M 0% /dev
tmpfs 124.9M 4.0M 120.9M 3% /tmp
/dev/mtdblock4 94.8M 2.3M 92.4M 2% /jffs
/dev/sda1 698.6G 2.1G 696.5G 0% /tmp/mnt/sda1

Disk scan process complete. Please check the detailed results below.

ntfsck 3014.5.21
Checking NTFS Superblock ...
Device name : /dev/sda1
NTFS volume version: 1.2
Cluster size : 4096 bytes
Current volume size: 750154412544 bytes (750155 MB)
Current device size: 750154416128 bytes (750155 MB)
Checking for bad sectors ...
Scanning $MFT ...
Checking directory structure ...
Checking for orphaned files ...
0.00 percent completed
...

98.93 percent completed
99.42 percent completed
99.92 percent completed
100.00 percent completed
Scanning orphaned files completed.
Checking attributes ...
0.00 percent completed
0.49 percent completed
...
99.42 percent completed
99.92 percent completed
100.00 percent completed
Checking cluster allocation ...
0.00 percent completed
0.49 percent completed
...
99.42 percent completed
99.92 percent completed
100.00 percent completed
Checking cluster allocation bitmap ...
Checking $MFT bitmap ...
0.00 percent completed
0.49 percent completed
...
99.92 percent completed
100.00 percent completed
Checking directory structure second time ...
Space in use : 2252 MB (0.3%)
Done NTFS checking and repair on device '/dev/sda1'.
Syncing device ...


Available space:

696.538 GB

Total space:

698.635 GB


I run chmod a+rx/jffs/scripts/* and I'll wait 30 minutes.

Thank you very much.
 
Last edited:
Disk info

One HDD, one partition, NTFS on USB 3.0 port.
...
I run chmod a+rx/jffs/scripts/* and I'll wait 30 minutes.

Thank you very much.

In the mean time, have a look at the home page. Take a screen shot. Does the disk look like like being scanned ? Do you see the available space at the bottom ?
 
My disk is mounted and showing as mounted in router ui, can I even browse files but script is executed after 5 minutes.
 
Yes, the HDD is mounted and the available space is displayed. I can access the disk.

It runs fast:
Jan 22 22:22:52 admin: sh /opt/S50asuslighttpd.1 start
Jan 22 22:22:56 admin: sh /opt/S50downloadmaster.1 start

that files are on the HDD.

Is any way to run the command like this ones?

Uptime 0 days 0 hours 27 minutes 17 seconds
and nothing changed...

Thank you.
 
I don't understand. It almost impossible. If the disk was mounted, the log would show the message. Does it ?

Let's try something else. When, at the terminal prompt, you enter the mount command, what is the answer?

If you reboot, can you immediately run the postmount script ?
 
mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=127780k,nr_inodes=31945,mode=755)
proc on /proc type proc (rw,relatime)
tmpfs on /tmp type tmpfs (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
/dev/mtdblock4 on /jffs type jffs2 (rw,noatime)
usbfs on /proc/bus/usb type usbfs (rw,relatime)
/dev/sda1 on /tmp/mnt/sda1 type tntfs (rw,nodev,relatime,uid=0,gid=0,umask=00,nls=utf8,min_prealloc_size=64k,max_prealloc_size=732572668,readahead=1M,user_xattr,case_sensitive,disable_sparse,nocache,fail_safe,hidden=show,dotfile=show,errors=continue,mft_zone_multiplier=1)

Yes, after restart I can immediately run sh post-mount in /jffs/scripts and it starts the server with no problems.

I edited: /sda1/asusware.arm/etc/init.d/S50downloadmaster and I managed to run commands at startup but only svnserve command is ignored..., it shows the system logs and creates /tmp/ file, but svnserve is not running:

#!/bin/sh
logger -t $(basename $0) "111Postmount: Started"
LD_LIBRARY_PATH=/opt/lib /opt/bin/svnserve -d -r /tmp/mnt/sda1/repo
logger -t $(basename $0) "111Postmount: Started AFTER SVN"

#! /bin/sh

touch /tmp/postmount.txt

is_arm_machine=`uname -m |grep arm`
.....


System log:
Jan 22 23:02:13 admin: sh /opt/S50asuslighttpd.1 start
Jan 22 23:02:17 admin: sh /opt/S50downloadmaster.1 start
Jan 22 23:02:17 S50downloadmaster.1: 111Postmount: Started^M
Jan 22 23:02:18 S50downloadmaster.1: 111Postmount: Started AFTER SVN^M
Jan 22 23:02:18 rc_service: hotplug 812:notify_rc restart_nasapps
Jan 22 23:02:18 iTunes: daemon is stopped
 
There's your answer....it's in the wrong format (see the ^M, that's a carriage return). If you open the file in vi you'll see the lines ending with ^M.

Use Notepad++ set to Linux format or the editor in WinSCP....
 
Thank you, I tried notepad++ but didn't fixed it.

I manage to solve it with

echo -e "#!/bin/sh\nLD_LIBRARY_PATH=/opt/lib /opt/bin/svnserve -d -r /tmp/mnt/sda1/repo" > post-mount

Thank you very much.
 
Thank you, I tried notepad++ but didn't fixed it.

I manage to solve it with

echo -e "#!/bin/sh\nLD_LIBRARY_PATH=/opt/lib /opt/bin/svnserve -d -r /tmp/mnt/sda1/repo" > post-mount

Thank you very much.
Your post-mount script is executed fine now?
I have to see why I get 5 minutes delay
 

Similar threads

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