Update script MailScanner contains upper_lower_case typo

Report bugs and workarounds
Post Reply
User avatar
plopperdeplop
Posts: 5
Joined: 30 Jul 2017 20:20

Update script MailScanner contains upper_lower_case typo

Post by plopperdeplop »

Hello All,

Found a small type in EFA 3.0.2.6 update script for MailScanner (/usr/local/sbin/EFA-MS-Update) has a small typo on line 173, 176, 181 and a few more.

When running the script by hand like so:

# /usr/local/sbin/EFA-MS-Update -update

--2018-08-10 09:22:23-- http://dl.efa-project.org/MailScanner/p ... sites.conf
.....
.....
.....

It completed okay.
/usr/local/sbin/EFA-MS-Update: line 173: /etc/init.d/MailScanner: No such file or directory
MailScanner reload failed - Retrying...
/usr/local/sbin/EFA-MS-Update: line 176: /etc/init.d/MailScanner: No such file or directory
Stopping MailScanner...
/usr/local/sbin/EFA-MS-Update: line 181: /etc/init.d/MailScanner: No such file or directory
Waiting for a minute...

You see that on line 173,176 and 181 the initd script /etc/init.d/MailScanner is called, actually the script is named /etc/init.d/mailscanner (all lowercase).
The init script /etc/init.d/MailScanner does not exist, I assume the intention is to call the script /etc/init.d/mailscanner.

So I created a patch for this purpose please find it below:

------- copy text below into a file e.g. /tmp/efa-ms-update.patch --------

--- /usr/local/sbin/EFA-MS-Update 2018-01-14 18:07:11.753713270 +0100
+++ /usr/local/sbin/EFA-MS-Update.fixed 2018-08-10 09:18:49.452242551 +0200
@@ -170,19 +170,19 @@

# Reload MailScanner only if we need to.
if [ "$reload" = "1" ]; then
- /etc/init.d/MailScanner reload #> /dev/null 2>&1
+ /etc/init.d/mailscanner reload #> /dev/null 2>&1
if [ $? != 0 ] ; then
echo "MailScanner reload failed - Retrying..."
- /etc/init.d/MailScanner reload
+ /etc/init.d/mailscanner reload
if [ $? = 0 ] ; then
echo "MailScanner reload succeeded."
else
echo "Stopping MailScanner..."
- /etc/init.d/MailScanner stop
+ /etc/init.d/mailscanner stop
echo "Waiting for a minute..."
sleep 60
echo "Attemping to start MailScanner..."
- /etc/init.d/MailScanner start
+ /etc/init.d/mailscanner start
fi
fi
fi
-------------- end of copy text above into a file e.g. /tmp/efa-ms-update.patch -----------

Apply patch with :

# patch /usr/local/sbin/EFA-MS-Update < /tmp/efa-ms-update.patch

And this should fix the upper_lower_case typo in the Update Script.

Keep up the EFA project :-)
henk
Posts: 517
Joined: 14 Dec 2015 22:16
Location: Netherlands
Contact:

Re: Update script MailScanner contains upper_lower_case typo

Post by henk »

Plopper,

Updating the update script will /could leave you with some issues. Just check your logs. :idea:

Searching this forum should be the first step, in case of issues during upgrades and other errors.
just create the sym link before the update script to solve all the problems for the changed mailscanner service as mentioned in the first post.

Code: Select all

# Add init.d symlink back for backward compatibility
# ln -s /etc/init.d/mailscanner /etc/init.d/MailScanner
You need to read:viewtopic.php?t=2892 and sure viewtopic.php?t=2928&start=37
“We are stuck with technology when what we really want is just stuff that works.” -Douglas Adams
User avatar
plopperdeplop
Posts: 5
Joined: 30 Jul 2017 20:20

Re: Update script MailScanner contains upper_lower_case typo

Post by plopperdeplop »

Ok good suggestion :).
Post Reply