Skip to content

Solaris 11 fixes and new configuration documentation#294

Closed
janorn wants to merge 3 commits into
github:masterfrom
janorn:master
Closed

Solaris 11 fixes and new configuration documentation#294
janorn wants to merge 3 commits into
github:masterfrom
janorn:master

Conversation

@janorn

@janorn janorn commented Mar 17, 2017

Copy link
Copy Markdown

I have made two changes to make backup-utils work on Solaris 11.
First change ps command= to ps comm= which is posix compliant.

Second I change the PATH if backup-utils is run on Solaris 11.
We add a path to GNU utils first and /usr/sbin due to unlink residing in /usr/sbin.

# In Solaris 11 reassure that gnu utils are used and add /usr/sbin for unlink
if [ "SunOS 5.11" = "$(uname -sr)" ]; then
PATH="/usr/gnu/bin:$PATH:/usr/sbin"
fi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having this here sets a precedent for similar behaviour and operations on other operating systems which we don't want. This could turn into a messy collection of OS-specific ifs.

I think this is better suited to live within your own copy of backup.config as this is the location best suited for customer/site specific customisations; you might have the GNU utils at /usr/gnu/bin on your Solaris 11 system, but it doesn't mean everyone does (the various GNU pkg are optional IIRC).

How about adding a commented out PATH= entry and generic comment to the end of the backup.config-example instead?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to state that /usr/gnu/bin is where solaris installs gnu tools provided by Oracle. It is nothing optional about this path. I will investigate the backup.config-example.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree 100%. The point I was trying to make is you don't need to install any of the GNU pkgs to get a fully functional Solaris 11 system. If you so desire, you can install the GNU utils from source into /usr/local/bin or the old traditional location for third party software of /opt instead. In these cases /usr/gnu/bin wouldn't be a valid path.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... and it's because of ☝️ that I think it would be best to define the PATH specific to your system in the backup.config file.

janorn added 2 commits March 17, 2017 15:15
command is not posix compliant comm is.
* Add path to GNU tools first
* Add /usr/sbin unlink is located in sbin.
@janorn

janorn commented Mar 17, 2017

Copy link
Copy Markdown
Author

I have now moved the PATH config as suggest to the example file. Please note that /usr/gnu/bin is where Oracle installs all provided gnu tools to separate them from the builtin tools. This is for Solaris 11 not Solaris 10. Many gnu tools are provided directly from Oracle.
http://www.sunsolarisadmin.com/solaris-11/gnu-tools-out-of-the-box-in-solaris-11/

Comment thread backup.config-example
# Modify you path here.
#
# Set this path on Solaris 11
#PATH="/usr/gnu/bin:$PATH:/usr/sbin"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's best to make this as generic as possible without any references to specific operating systems. I know Solaris puts the GNU utils here (I used to work for Sun and then Oracle on Solaris 😄) but we shouldn't mention this in the configuration example as it's not generic.

How about modifying this to:

# The PATH for the backup utilities to use. The default PATH used is that of the 
# executing user which may not always be customizable or contain all the utilities
# required by the backup utilities.
#
# PATH=""

This leaves things very generic and open to customisation that best suites the operating system or environment.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So where should information for future users be placed so they don't have todo all investigation over again...

I worked for Sun+Oracle 10+ years.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we document in the README.md, we rely on the comments in the configuration file to explain the purpose of each settings so I think this is a good place and generic enough for most sysadmins to find and understand, regardless of operating system. I think it's only a matter of getting the wording correct to keep things generic whilst at the same time conveying that this is what needs to be modified, regardless of OS, if commands are not in the path of the executing user.

I worked for Sun+Oracle 10+ years.

So did I. 👋 fellow Sun alumnus.

Comment thread bin/ghe-backup
snapshot=$(echo "$progress" | cut -d ' ' -f 1)
pid=$(echo "$progress" | cut -d ' ' -f 2)
if ! ps -p $pid -o command= | grep ghe-backup; then
if ! ps -p $pid -o comm= | grep ghe-backup; then

@rubiojr rubiojr Apr 11, 2017

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janorn this change will break backup-utils on Linux hosts unfortunately, it's not equivalent:

rubiojr@enterprise2-dev5-cp1-prd:~/backup-utils$ ps -p 103090 -o comm=
bash
rubiojr@enterprise2-dev5-cp1-prd:~/backup-utils$ ps -p 103090 -o command=
bash ./bin/ghe-backup

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about ps -p 103090 -o args? according to https://docs.oracle.com/cd/E26502_01/html/E29030/ps-1.html, that may work on Solaris too?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rubiojr seems to be the same on solaris. Never tested this on a running backup. args works on solaris.

ghebup@backup:~$ cat data/in-progress 
20170411T140748 7198
ghebup@backup:~$ ps -p 7198 -o comm
COMMAND
bash
ghebup@backup:~$ ps -p 7198 -o args
COMMAND
bash /home/ghebup/backup-utils/bin/ghe-backup -v

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janorn thanks. Feel free to update the branch so we can merge it.

@rubiojr rubiojr added the bug label Apr 11, 2017
@rubiojr rubiojr changed the title Small changes to make backup-utils work on Solaris 11 Solaris 11 fixes and new configuration documentation Apr 11, 2017
@lildude

lildude commented Jan 9, 2018

Copy link
Copy Markdown
Member

Whoops, this PR seems to have stagnated. Do you have the cycles to address the current suggestions and conflicts so we can progress this PR @janorn?

If not, no probs. I can spin off a new PR with all the changes.

@lildude

lildude commented Sep 6, 2018

Copy link
Copy Markdown
Member

Closing in favour of #436

@lildude lildude closed this Sep 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants