Linux CentOS Server Startscript: Minecraft Server - linux

Recently tried using the following startscript here:
http://dev.bukkit.org/bukkit-plugins/linux-server-startscript-menu/
After installing dos2unix, it says it is installed and using the latest version. I then use the command "dos2unix startserver.sh" and I prompted with the message: "dos2unix: converting file startserver.sh to UNIX format ..." and then it returns to the next blank command line. Problem is there is nothing actually starting the script or I am missing something. I have tried talking to the owner of this script and he helped me to this point, but is unsure what to do next. He says he uses debian and is less familiar with CentOS and so I am posting here.
Here is my script that has been edited according to my server. The most important change I made is SCRIPTUPDATE="0" (so it doesn't update)
Please keep in mind that I am very new to linux and any operating systems in general.

The dos2unix command converts the newline characters in a file from dos format to unix format. This is just for cleaning up a file that may have problems (e.g., from a bad ftp transfer).
Try running the ./startserver.sh command again, now that the file has been cleansed.

Related

VS Code, how to set up for writing for linux machine

I have been working with a script, which I haven't done for some time now. It was suggested to me to use VS code to develop the script and then I use pscp to get the file from my windows computer into the Linux machine which I am connected to.
Once I do this and attempt to run the script on the Linux machine I get the following error:
/bin/bash^M: bad interpreter: No such file or directory
In my settings.json file of VS Code I have my terminal.intergrated.shell.windows set to a bash.exe. I have came across this question:
Bash script and /bin/bash^M: bad interpreter: No such file or directory
and from it one of the suggestions was because I am importing from a windows to linux machine there are some characters which do not cross over correctly thus the ^M error. Is there a way to set up VS Code to code in a Linux environment when it is transferred over?
Thanks for any info!
at the bottom of VSCode there should be a little toolbar.
If you click on CRLF and instead change it to LF your problems should be resolved when developing the code from then onwards. The reason this happens is because whenever you create a new line in Windows it takes two characters to do so. The CR (Carriage Return) and LF (Line Feed) whereas Linux only uses LF (Line Feed).
Hope this helped :)

sh file not found in linux command line

I'm an owner of synology's diskstation NAS server running on special OS (mainly linux)
It has only access from internet. I established command line interface to access it using synology wiki. Now I try to install Counter-Strike server on it using SteamCMD. I just look in Valve Developer Community for it.
I'm writing the next:
mkdir csServer
cd csServer
wget http://media.steampowered.com/client/steamcmd_linux.tar.gz
tar xvfz steamcmd_linux.tar.gz
./steamcmd.sh
But the last line causes -sh: ./steamcmd.sh not found. However, I can see this file in the directory.
What actually can cause it?
//ADDED
The file is executable!
Your script contains a header which says #!/bin/bash, that is use /bin/bash to execute this script. Apparently, on your system /bin/bash is not present. I am not familiar with Synology environment, but you should be able to fix this problem by installing bash and then pointing your script to the right path, which should be /opt/bin/bash. The first line of your script should therefore look like the following
#!/opt/bin/bash
You could also use Synology default ash, but beware that you script might not work as it was written for bash.
Windows style end-of-lines (CRLF) can cause this issue. If your sh file contains Windows style end-of-lines, convert it to Linux style.

Xampp on linux mint

im trying to install xampp on "new" linux mint machine.
However im quite a noob to linux since i havnt used it for that long.
When i try to run the file that ive download from the following page:
Xampp download
i get the following error two errors:
Could not display "/home/marc/Downloads/xampp-linux-x64-1.8.3-0-installer.run".
and if i click yes
Installing mime type handlers isn't supported
To search and install software which can open certain file types you have to install app-install-data.
can anyone tell me what the problem is and how i might fix it?
you need to execute the file (e.g. open a terminal, navigate to your Downloads folder and run bash xampp-linux-x64-1.8.3-0-installer.run (possibly it might need to be run otherwise, but thats my best guess)).
alternatively you might be presented to run/execute the file (instead of displaying it). if so, choose this option.
on the other hand, you might consider installing apache/php/mysql via your package manager.
what you can do is that you can use the chmod +x /your folder location/.run file that you want to install
after that you can run following command
./and your .run file name
example:-
in my case :- User#user~$su root
it will ask for password so give it
User#user~chmod +x /Downloads/xampp-linux-x64-1.8.3-0-installer.run
User#user~./xampp-linux-x64-1.8.3-0-installer.run

Can Linux Bash scripts respond to install options

I need to script the installation of a number of products on Redhat Linux
I am installing from previously downloaded tar files that each contain their own specific install.sh.
My problem is that by executing the install.sh scripts a number of questions are asked such as ...
a). Accept license
b). set default path(s)
c). do i wish to start service
etc...
Can Bash detect these questions and respond correctly? or do i require another linux based product/function?
For windows based installs i have used AutoItScript.
What are my options on Linux Redhat?
To establish whether the scripts support any command line options, you can:
Read the readme file of the software, if there is one. This should explain any options.
Read the top of the install.sh script. Usually options are at least listed there.
Read the code itself, which might be a lot of work.
Once you have established that the scripts do not support options, the standard way of automating this would be with an expect script. See for example automating install.sh script using an expect script.
Depending on how the install script works, you may be able to send it commands on standard input. For example, if you press Tab once, then Enter, then y and lastly Enter again, you can try the following:
printf %s $'\t\ny\n' | ./install.sh

Environment Variable not being passed to CruiseControl, specifically the 'nodosfilewarnings' ENV variable from Cygwin

I have a Perl program that someone else created and I am calling on with CruiseControl. The program calls on Unix Commands using Cygwin. However, everytime that the Perl program calls on a Unix like command with a DOS like address, I get the well known error:
cygwin warning:
MS-DOS style path detected: E:\regression
Preferred POSIX equivalent is: /cygdrive/e/regression
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
I have set both the User Variable AND System Variable CYGWIN to nodosfilewarning. This removes the error when I run the program from the command line, but the error still occurs in CruiseControl when called as an automated process from a batch file. I have called on both the batch file from the Desktop AND Command Line and ran as an administrator. Nothing changes.
Other Notes
For purposes of this problem, I don't have access to the Perl Program
I am trying to go back to Cygwin 1.5.*, but since I am using Server 2008, I am encountering compatibility issues
This is occurring on one of the distributed servers, not the main server running the Webdashboard.
I have read somewhere that this issue may stem from a different user calling on CruiseControl, but the issue should have been solved by setting this as an ENV System variable
Is it possible to modify the registery to set the ENV variables?
Thank you in advance
The way I do it is like this
printf 'export CYGWIN=nodosfilewarning' >> ~/.bash_profile
If CruiseControl is connecting to the server via ssh, reinstall sshd and explicitly include nodosfilewarning when prompted for the CYGWIN environment variable during the install.
Re-installing with modified environment will work but if you don't want to or cannot re-install, an alternative is to change the registry instead of re-installing the service.
See: CYGWIN windows cygrunsrv sshd server and MS-DOS style path detected

Resources