NetBackup executables that were built with perl2exe fail to run properly because they do not have read, write, exec access to /tmp path.

Article: 100033713
Last Published: 2020-04-17
Ratings: 3 0
Product(s): NetBackup & Alta Data Protection

Problem

NetBackup executables that were built with perl2exe fail to run properly because they do not have read, write, exec access to /tmp path. Examples would be the NBSU or nbdeployutil executables.

Error Message

Snippet from command output:

Can't load '/tmp/p2xtmp-2298/auto/Fcntl/Fcntl.so' for module Fcntl: /tmp/p2xtmp-2298/auto/Fcntl/Fcntl.so: failed to map segment from shared object: Operation not permitted at PERL2EXE_STORAGE/DynaLoader.pm line 190.
 at PERL2EXE_STORAGE/POSIX.pm line 19
Compilation failed in require at PERL2EXE_STORAGE/POSIX.pm line 19.
BEGIN failed--compilation aborted at PERL2EXE_STORAGE/POSIX.pm line 19.
Compilation failed in require at PERL2EXE_STORAGE/Common/Log.pm line 14.
BEGIN failed--compilation aborted at PERL2EXE_STORAGE/Common/Log.pm line 14.

Can't load '/tmp/p2xtmp-37690/auto/Socket/Socket.so' for module Socket: /tmp/p2x tmp-37690/auto/Socket/Socket.so: failed to map segment from shared object: 
Operation not permitted at PERL2EXE_STORAGE/DynaLoader.pm line 190. at  PERL2EXE_STORAGE/Net/FTP.pm line 17 
Compilation failed in require at PERL2EXE_STORAGE/Net/FTP.pm line 17. 
BEGIN failed--compilation aborted at PERL2EXE_STORAGE/Net/FTP.pm line 17.

Cause

/tmp is unavailable or is mounted with noexec.

perl2exe executables use temporary directory path by reading environmental variables $TEMP first then $TMP second.  If neither is set, it defaults to /tmp. If both are set, perl2exe uses $TEMP. perl2exe does not use $TMPDIR at all.

Solution

To workaround using the default /tmp path, the user must prepare an alternate temporary path with read, write, and executable access for the root user then set $TEMP to that path.

  1. Log in as root user.
  2. First check if either $TEMP or $TMP is set.
    • Take note in case settings need to be reverted: printenv | egrep "TEMP|TMP"
  3. Prepare an alternate temporary path with read, write, exec access for root user.
    • For this example, /usr/openv/tmp/root_tmp
      • mkdir -p /usr/openv/tmp/root_tmp
      • chown -R root:root /usr/openv/tmp/root_tmp
      • chmod -R a-rwx /usr/openv/tmp/root_tmp
      • chmod -R u+rwx /usr/openv/tmp/root_tmp 
  4. Set $TEMP to alternate path: export [or setenv] TEMP=/usr/openv/tmp/root_tmp
  5. Re-run the NetBackup executable.
  6. Revert TEMP to previous value, if none, unset it: unset TEMP

​User environmental variables set in the login shell should be temporary and stay effective for that shell session until the user logs off. It also does not affect other shell terminals.

For example:

  • User1 logs in as root on ShellTermA.
  • User2 logs in as root on ShellTermB on the same host.
  • User2 set $TEMP to /usr/openv/tmp/root_tmp.
  • This does not affect $TEMP for User1's root user session.
  • For User2, $TEMP is effective until User2 unsets it, modifies it, or logs out.

Was this content helpful?