Can I change the default MID Server upgrade path from /tmp to something else?

Jeff Boltz1
Mega Guru

Hi Everyone,

I am migrating our MID servers from Windows to RHEL.

During upgrades, ServiceNow places the upgrade files under /tmp, and then tries to execute from there.

Our RHEL team has hardened the servers such that /tmp is mounted as non-executable, and there are no exceptions to the policy.  What happens is the upgrade fails, and the upgrade needs to be done manually.

Is there a way to change the upgrade path from /tmp to something else?  If not, are there any ideas for me to automate the upgrade process myself?  So the pseudo-code might be something like:

wget [ServiceNow MID Server download]
unzip
stop.sh
mv /agent /agent_OLD
cp /tmp/agent /mymid
chmod +x start.sh
chmod +x stop.sh
start.sh​

Thanks for looking.

Take care,

Jeff

 

1 ACCEPTED SOLUTION
6 REPLIES 6

DaveHertel
Kilo Sage
Kilo Sage

Hi Jeff --  I can't add anything to your original question.

  But... did want to share, just in case you are unaware, that linux-based MID's can't discovery Windows targets.  Since you are moving from existing Windows-based MIDS I presume your company might already be scanning at least some windows-based targets.  Just know those MID's being repositioned on RHEL/Linux won't be able to scan Windows machines via WMI.  Just in case FYI....

Hi Dave,

Thanks for that - much appreciated. 

Not currently discovering Windows *right now*, but can cross that bridge when we get there if needed in future.  Was thinking about either adding a Win server, or trying out libwmiclient/wmi-client (https://www.krenger.ch/blog/wmi-commands-from-linux/). 

Take care,

Jeff

Dave Mau
ServiceNow Employee
ServiceNow Employee

According to the docs we use java.io.tmpdir

https://docs.servicenow.com/bundle/london-servicenow-platform/page/product/mid-server/reference/mid-server-pre-upgrade-check.html

Seems like you can set this using either java opts or something in your bash_profile.  I don't know how you'd set this with the included java.  Perhaps putting this in one of the wrapper files.

 

-Dave

Hi Dave,

Thank you for your help - much appreciated.

I thought I would provide the steps I used to get the MID server to auto-upgrade on RHEL using an external JRE.

1.  Start with at least a London or higher MID server

2.  Add these lines to the MID server user's ~/.bashrc:

# User specific aliases and functions
export JAVA_HOME="/MID/user/jre"
export _JAVA_OPTIONS="-Djava.io.tmpdir=/MID/user/tmp"

3.  Run source ~/.bashrc

4.  Verify by running:

echo $JAVA_HOME

echo $_JAVA_OPTIONS

5.  Run sh start.sh, and hopefully you will see the MID on the instance.  It will start/stop a couple of times as it upgrades.

Thanks,
Jeff