/usr/local/bin/qtpasswd: No such file or directory - linux

I'm Trying to install Darwin Streaming Server on virtualbox ubuntu desktop amd64.
Running the darwin setup at the end gives this
./Install: line 406: /usr/local/bin/qtpasswd: No such file or directory
./Install: line 406: /usr/local/bin/qtpasswd: No such file or directory
Setup Complete!
And When I hit the url on the browser it says
"Server is not running please start it before attempting to administer it".

you can post your complete installing log.
i run into the same error prompt as yours while i build my Darwin Stream Server-5.5.5 source on centOS6.5 .
you can modify part of the installing script "Install" (about line 191)
# Add the unprivileged user qtss as the server's run user
echo "Creating unprivileged user to run the server = \"qtss\"."
if [ $INSTALL_OS = "Linux" ]; then
/usr/sbin/useradd -M qtss > /dev/null 2>&1
else
/usr/sbin/useradd qtss > /dev/null 2>&1
fi
into
# Add the unprivileged user qtss as the server's run user
echo "Creating unprivileged user to run the server = \"qtss\"."
if [ $INSTALL_OS = "Linux" ]; then
groupadd -r qtss
/usr/sbin/useradd -M -r -g qtss qtss > /dev/null 2>&1
else
/usr/sbin/useradd qtss > /dev/null 2>&1
fi
then try to run ./Install again.
it works for me.
make sure you have installed perl before you run ./Install

Related

systemctl start service does not work in SPEC file

I met a problem that the command "sudo systemctl start xxx.service" in my SPEC file does not work when upgrading my RPM package, following is my %post script in SPEC file,
%post
echo "---------------------------- post $1 -------------------------------"
# refresh installation
if [ $1 == 1 ]; then
sudo echo "Installation finished."
# upgrade installation
elif [ $1 -gt 1 ]; then
sudo echo "Starting service xxx.service..."
sudo /usr/bin/systemctl enable xxx.service > /dev/null 2>&1
sudo /usr/bin/systemctl start xxx.service
sleep 10
sudo echo "Finished."
fi
exit 0
I'm sure that the service file already exists in directory /usr/lib/systemd/system, and I can start it manually using the command "sudo systemctl start xxx.service".
And I found that the "sleep 10" command does not work too.
Very appreciated if there is any suggestion about this issue, thanks.
Few issues:
You're not supposed to use sudo in scriplets, because 1) it may not be installed 2) rpm installation runs as superuser anyway
You should use the standard RPM macros for SystemD as opposed to reinventing the wheel.
Essentially that simply goes down to:
%{?systemd_requires}
BuildRequires: systemd
# ...
%post
%systemd_post %{name}.service
%preun
%systemd_preun %{name}.service
%postun
%systemd_postun_with_restart %{name}.service
# ...
Take note that the SystemD macros for CentOS/RHEL are within systemd package, while in Fedora they are now in systemd-rpm-macros.
Placing the service startup command in the scriptlet "%posttrans" resolves my problem, thanks for all your suggestions.

Installing and running .sh file in linux mint

I'm using Linux mint and I want to install COMSOL. The problem is that, when I run below code in terminal, there is an error which doesn't make sense. Could anyone solve the problem?
The code I wrote:
./COMSOL_Server_Workaround.sh
the error is:
COMSOL Server Installer Work-around Script
2016 TeAM SolidSQUAD-SSQ
./COMSOL_Server_Workaround.sh: 14: [: Linux: unexpected operator
./COMSOL_Server_Workaround.sh: 15: [: Linux: unexpected operator
-e ERROR: This script should be executed
from the COMSOL Server installation directory
(where comsolsetup.log resides)
picture of files
COMSOL_Server_Workaround.sh contains:
#!/bin/sh
echo
echo COMSOL Server Installer Work-around Script
echo 2016 TeAM SolidSQUAD-SSQ
echo
# assume working dir is COMSOL installation root
COMSOLROOT="$PWD"
# check architecture
[ "`uname`" == "Linux" ] && COMSOL_TARS="fl fl_setup_glnxa64 fl_setup_maclnx fl_jvm_glnxa64 fl_glnxa64 mph_maclnx mph_glnxa64"
[ "`uname`" == "Darwin" ] && COMSOL_TARS="fl fl_setup_maclnx fl_maclnx fl_jvm_maci64 fl_maci64 mph_maclnx mph_maci64"
# tell user he has to run the script from COMSOL Server folder
[ ! -e "$COMSOLROOT/comsolsetup.log" ] && echo -e "ERROR: This script should be executed\n from the COMSOL Server installation directory\n (where comsolsetup.log resides)" && exit 1
# check if we can write to folder
[ ! -w "$COMSOLROOT/comsolsetup.log" ] && echo -e "ERROR: Cannot write to folder \"$COMSOLROOT\".\n If COMSOL Server was installed as root, run this script as root too\n otherwise run it as user which made the installation of COMSOL Server!" && exit 2
# let us extract the source location and check if it accessible
COMSOLDVD="`grep "^cs.installroot" "$COMSOLROOT/comsolsetup.log" | awk '{print $3}'`"
echo "COMSOL SERVER Installation Path = $COMSOLROOT"
echo "COMSOL Server Installation Source Path = $COMSOLDVD"
# check if source is accessible
[ ! -r "$COMSOLDVD/setupconfig.ini" ] && echo "The installaton source \"$COMSOLDVD\" id not accessible! Make sure the DVD is mounted" && exit 3
# now start untaring FL archives
for COMSOL_TAR in $COMSOL_TARS
do
tar -xf "$COMSOLDVD/archives/$COMSOL_TAR.isa" -C "$COMSOLROOT"
done
# Null the bin\tomcat\conf\login.properties
echo > "$COMSOLROOT/bin/tomcat/conf/login.properties"
# Mission complete
echo
echo All done! Enjoy!
echo
exit 0

Shell script to verify docker installation on Linux

I want to write a shell script which verifies whether docker is installed or not.
If docker is installed:
$ docker -v
Docker version 1.7.0, build 0baf609
$ echo $?
0
If docker is not installed:
$ docker -v
The program 'docker' is currently not installed. You can install it by typing:
apt-get install docker
$ echo $?
127
Here is my script:
#!/bin/bash
docker -v
if echo $? = 128 ; then
echo "The program 'docker' is currently not installed."
else
echo "Continuing with dockerized way"
fi
here for testing purpose, I ran it on the machine where docker is not installed, I kept 127 = 128, condition is wrong, so it should go in else, but still it prints The program 'docker' is currently not installed. I would like to know what I am missing here.
The correct syntax is:
if [ $? -eq 128 ]; then
...
To make it even more robust, you might want to check:
if [ $? -ne 0 ]; then
...

Disable sudo for a single command in a sh file on macOS Sierra

I have been looking everywhere for something to disable sudo access for this one command while maintaining sudo for the rest for the script. The script is called using sudo e.g. "sudo ./install.sh". The snippet in question is this (I currently was trying to make a new user to call the command, but to no use):
echo >&2 "Installing Homebrew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
I only want line 2's command to run as not root/ no sudo. I am very much a noob, so any guidance/alternative methods not including making a new user, would be very appreciated.
If the script was run with sudo, then you can use $SUDO_USER to get the original username:
echo >&2 "Installing Homebrew"
sudo -u "$SUDO_USER" /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
(And don't use sudo on the other commands in the script -- if the script itself is run with sudo, that's completely redundant.)
BTW, this will fail completely if the script was not run with sudo -- for example, if someone logs in as root and runs it, uses su to switch to root and run it, etc. It might be better to check first, something like this:
if [ -n "$SUDO_USER" ]; then
echo >&2 "Installing Homebrew"
sudo -u "$SUDO_USER" /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
echo "No original user found to install Homebrew under" >&2
fi

Linux Shell commands work when manually typed. Don't work when put in a script file

I have this Linux script called LinuxCommands used to check to make sure that my machine has the pre-requisites that Oracle requires for an install. The script will work if I copy all of the text from a Windows notepad and paste it into my Linux terminal, but don't work when I ftp over the actual .sh file to the Linux terminal and run it by calling bash. The script does not work at all if I use ./ notation. I am using root for both copying the commands and running the file using ./ or bash notation. The Linux script is as follows
#!/bin/bash
#Install packages, upgrade those that already exist
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' binutils-2.17.50.0.6 compat-libstdc++-33-3.2.3 compat-libstdc++-33-3.2.3 elfutils-libelf-0.125 elfutils-libelf-devel-0.125 gcc-4.1.2 gcc-c++-4.1.2 glibc-2.5-24 glibc-common-2.5 glibc-devel-2.5 glibc-headers-2.5 ksh-20060214 libaio-0.3.106 libaio-devel-0.3.106 libgcc-4.1.2 libstdc++-4.1.2 libstdc++-devel make-3.81 sysstat-7.0.2|grep "install ok installed")
echo Checking for libraries: $PKG_OK
if [ "" == "$PKG_OK" ]; then
echo "Not Installed. Installing"
yum -y install binutils-2.17.50.0.6 compat-libstdc++-33-3.2.3 compat-libstdc++-33-3.2.3 elfutils-libelf-0.125 elfutils-libelf-devel-0.125 gcc-4.1.2 gcc-c++-4.1.2 glibc-2.5-24 glibc-common-2.5 glibc-devel-2.5 glibc-headers-2.5 ksh-20060214 libaio-0.3.106 libaio-devel-0.3.106 libgcc-4.1.2 libstdc++-4.1.2 libstdc++-devel make-3.81 sysstat-7.0.2
fi
#Adds oinstall and dba groups
/bin/id -g oinstall 2>/dev/null \
[ $? -eq 0 ] && echo "Group found" || sudo /usr/sbin/groupadd oinstall
/bin/id -g dba 2>/dev/null \
[ $? -eq 0 ] && echo "Group found" || sudo /usr/sbin/groupadd dba
#Adds oracle user in oinstall group
if id -u oracle >/dev/null 2>&1; then
echo "user exists"
else
/usr/sbin/useradd -m -g oinstall -G dba oracle
fi
#Creates installation directory for Oracle
chown -R oracle:oinstall /u00/Oracle12CInstall
chmod -R 775 /u00/Oracle12CInstall
#Adds Oracle variables to the Oracle User's profile.
cat <<EOF > /home/oracle/.bash_profile
ORACLE_BASE=/u00/Oracle12cInstall
ORACLE_HOME=$ORACLE_BASE/test2/product/121
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export ORACLE_BASE
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:/usr/X11R6/bin:/usr/lib
export PATH
export ORACLE_BASE ORACLE_HOME LD_LIBRARY_PATH
umask 022
EOF
The error I get when I run it on a Linux terminal is
bash LinuxCommands
: command not found 3:
LinuxCommands: line 4: dpkg-query: command not found
Checking for libraries:
LinuxCommands: line 47: syntax error: unexpected end of file
This question was solved by running
dos2unix LinuxCommands
Command above removed DOS line endings from my file snd it was able to run sucessfully.

Resources