This is a simple way to get Shoutcast restarted (tested in Ubuntu 8.04) if the inbound stream is lost. You need Lynx installed for this to work, there might be better ways of achieving the same result though. To install Lynx:
$ sudo apt-get install lynx
Put in file shoutcast_supervisor.sh in /usr/bin:
#!/bin/bash
ONLINE=$(lynx -dump localhost:8000 | grep "Stream is up" | wc -l)
if [ "$ONLINE" -eq "0" ]
then
logger -i Inbound connection not found. Restarting Shoutcast.
/etc/init.d/shoutcast restart
fi
Change ownership, group and execution:
$ sudo chown root /usr/bin/shoutcast_supervisor.sh
$ sudo chgrp root /usr/bin/shoutcast_supervisor.sh
$ sudo chmod +x /usr/bin/shoutcast_supervisor.sh
Add the script to cron.d your preferred way, I do it in /etc/cron.d in a file name shoutcast_supervisor:
0 * * * * root /usr/bin/shoutcast_supervisor.sh
15 * * * * root /usr/bin/shoutcast_supervisor.sh
30 * * * * root /usr/bin/shoutcast_supervisor.sh
45 * * * * root /usr/bin/shoutcast_supervisor.sh
Restart cron:
$ sudo /etc/init.d/cron restart
…and the script is run every 15 minutes and will restart the Shoutcast daemon if the inbound connection was lost. Change the interval if you need to check more often. Sometimes this solves connection problems. Check the syslog for any message that the daemon was restarted, like:
$ tail /var/log/syslog
I just followed Julian’s excellent guide and it worked! Even though the guide was for previous versions of both Notes, Ubuntu and Wine, I did not have to make any additional steps to get it working. All programs works, I haven’t found anything that is broken (yet), and it’s great having the Designer “directly” in Ubuntu instead of firing up VirtualBox.
Thanks Julian, for your excellent guide!
For a complete list, see Bash Reference Manual – Bash Environment Variables. This is just my own memory-dump. To get the value of a variable, you can use:
echo $OLDPWD
Just a memory dump for important files and directories.
Also see Filesystem Hierarchy Standard.
There are a lot of these on the net. Why not one more? :-) I will try to keep this updated. Some commands are shell-specific (I use bash), and some are application specific, like the Apache commands.
Also see the good man-page-like command list at Oreillynet.
If you want to stream your own radio station, Shoutcast is an easy solution. This little HOWTO focus only on the server part, and not on the actual audio/feeding client part. I recommend reading ShoutCast Streaming for beginners and Streaming radio with ShoutCast and WinAmp to get the hang of the audio part.
Download the tarball from shoutcast.com.
$ tar -xvf sc_serv_1.9.8_Linux.tar.gz
$ sudo cp sc_serv_1.9.8_Linux/sc_serv /usr/sbin
$ sudo mkdir /etc/shoutcast
$ sudo cp sc_serv.conf /etc/shoutcast
This will make shoutcast start when the server starts. Download the initscript (which I have modified to work in Ubuntu 8.04, source script here).
$ sudo cp shoutcast /etc/init.d/shoutcast
$ sudo update-rc.d /etc/init.d/shoutcast defaults
The default sc_serv.conf says logging should go to the current directory. I changed the lines:
LogFile=sc_serv.log
...
W3CLog=sc_w3c.log
into:
LogFile=/var/log/sc_serv.log
...
W3CLog=/var/log/sc_w3c.log
Also, make sure you set a password on the line saying:
Password=changeme
If you have a locally installed firewall, you have to open up two ports. First the port mentioned in sc_serv.conf on the line saying:
PortBase=8000
The second is the PortBase + 1, i.e. in the default example above it is 8001. The 8001 port is used to receive data from Winamp or other audio streaming feeder and the 8000 port is used to send streaming audio to listening clients. Make sure both ports are open for TCP and UDP. And don’t forget any hardware firewalls, they have to be opened too.
Restart the server or do:
$ sudo /etc/init.d/shoutcast start
and try opening localhost:8000 in your browser and you should see the (in-)famous Shoutcast page.
This minimalistic guide shows how to install Domino 7.0.2 on Ubuntu 8.0.4 server or workstation. I did this on Ubuntu 7, but did not write everything down, which meant learning/searching for the information once more. Please let me know if you have better ways of doing this!
$ sudo useradd -m domino
$ sudo groupadd domino
$ sudo passwd domino
Domino uses some libraries that is not installed by the standard Ubuntu installation.
$ sudo apt-get install libstdc++5
$ sudo apt-get install libxmu6
$ sudo apt-get install libxp6
$ sudo apt-get install libxp-java
$ sudo apt-get install libxtst6
Unpack the installation file (my is named S7.0.2.tar) and run the linux/domino/install script as root. Use default settings (except user, enter domino), use “Manual setup”.
$ tar -xvf S7.0.2.tar
$ cd S7.0.2/linux/domino
$ sudo install
Since you installed as root, the files is owned by root. I guess if install was run as the domino user, this step would not be required.
$ sudo chown -R domino /local/notesdata
$ sudo chgrp -R domino /local/notesdata
$ sudo chown -R domino /opt/ibm
$ sudo chgrp -R domino /opt/ibm
Stop your local firewall or open 1352 in the local firewall. If you are using shorewall, you can do your own Notes macro. Change the port from 80 to 1352 in the macro.Notes file.
$ sudo cp /usr/share/shorewall/macro.HTTP /usr/share/shorewall/macro.Notes
$ sudo gedit /usr/share/shorewall/macro.Notes
Add the following (depending on setup…) to /etc/shorewall/rules:
Notes/ACCEPT net $FW
Stop any mail, web, ldap services, so that Domino does not conflict on ports. Remember to disable those you don’t need or disable the Domino services that you don’t need.
$ sudo /etc/init.d/postfix stop
$ sudo /etc/init.d/courier-imap stop
$ sudo /etc/init.d/courier-imap-ssl stop
The server script uses /bin/sh, relink sh to bash that normally links to /bin/dash.
$ sudo rm /bin/sh
$ sudo ln -s /bin/bash /bin/sh
I got many “Command not found” errors when starting the server first time. After some research, I found that the script requires gawk in sd.sh:
$ sudo apt-get install gawk
$ su notes
$ DISPLAY=:0.0
$ export DISPLAY
$ cd /local/notesdata
$ /opt/ibm/lotus/bin/server -listen
If you want to add a server with existing IDs, put the certifier ID, the server ID and the admin ID in the notesdata directory on the server. Run the Remote Server Setup utility on a client. Usually in Start\Lotus Applications\Remote Server Setup. Configure as a normal setup.
To be able to start Domino on startup, restart it and shutdown when system restarts, you can download domino init.d-script and put in /etc/init.d. Restart the server to see if it works.
$ cd /etc/init.d
$ sudo wget http://johankanngard.net/wp-content/uploads/2008/07/domino
$ sudo chmod +x domino
$ sudo chown domino domino
$ sudo chgrp domino domino
$ sudo update-rc.d domino defaults
$ sudo shutdown -r now
Use a Notes client and test that the server is up and running. To see if the server is running on the server, you use telnet.
$ ps a | grep server
4505 pts/0 Ss+ 0:00 su - domino -c /opt/ibm/lotus/bin/server
You can also try connecting to the server locally with telnet using:
$ telnet localhost 1352
Trying 127.0.0.1...
Connected to localhost.
Escape character is \\\\\\\\\\\\\\\'^]\\\\\\\\\\\\\\\'.
Updated the startup script since the stop argument wasn’t working.
I am about to change my home server from Windows to Linux, and started looking at Ubuntu. It’s very easy to install and manage, and there are lots of good HOWTO’s out there, like “How to set up a mail server on a GNU / Linux system“. I will try getting Domino to run on it too, but time is money these days…
[tags]Ubuntu, Linux[/tags]