daemonize-liquidsoap.sh not working - raspberry-pi

I've followed instructions here about installing liquid soap:
https://www.linuxjournal.com/content/creating-internet-radio-station-icecast-and-liquidsoap
This part I'm falling into difficulty:
$ git clone https://github.com/savonet/liquidsoap-daemon
$ cd liquidsoap-daemon
$ ./daemonize-liquidsoap.sh
It all works apart from:
$ ./daemonize-liquidsoap.sh
which produces:
Couldn't find a script at main, /home/radio/liquidsoap-daemon/script/main or /home/radio/liquidsoap-daemon/script/main.liq
Here is the list of folder /home/radio/liquidsoap-daemon:
-rw-r--r-- 1 root root 504 CHANGES
-rwxr-xr-x 1 root root 3619 daemonize-liquidsoap.sh
-rw-r--r-- 1 root root 1409 liquidsoap.initd.in
-rw-r--r-- 1 root root 541 liquidsoap.launchd.in
-rw-r--r-- 1 root root 326 liquidsoap.systemd.in
-rw-r--r-- 1 root root 1187 opam
-rw-r--r-- 1 root root 1922 README.md
What am I doing wrong?
Many thanks!

You are missing the script at /home/radio/liquidsoap-daemon/script/main
Create the folder script at /home/radio/liquidsoap-daemon/ and the file main.liq with e.g. output.dummy(blank()) in it.

Related

How to create a symlink to point to latest rotating log file

I've my application log file which keeps rotating and it has a pattern like below
postgresql-yyyy-mm-dd_hhmmss.log
-rw-------. 1 root root 331 Jun 1 22:04 postgresql-2022-06-01_220333.log.gz
-rw-------. 1 root root 417 Jun 1 22:04 postgresql-2022-06-01_220430.log.gz
-rw-------. 1 root root 289 Jun 2 19:28 postgresql-2022-06-02_000000.log.gz
-rw-------. 1 root root 26802 Jun 2 19:50 postgresql-2022-06-02_192809.log.gz
-rw-------. 1 root root 8440 Jun 2 23:57 postgresql-2022-06-02_195044.log.gz
-rw-------. 1 root root 15016 Jun 3 11:22 postgresql-2022-06-03_000000.log.gz
-rw-------. 1 root root 291 Jun 3 11:24 postgresql-2022-06-03_112405.log.gz
-rw-------. 1 root root 336 Jun 3 11:25 postgresql-2022-06-03_112553.log.gz
-rw-------. 1 root root 397 Jun 3 11:27 postgresql-2022-06-03_112714.log.gz
-rw-------. 1 root root 358 Jun 3 11:29 postgresql-2022-06-03_112901.log.gz
-rw-------. 1 root root 493 Jun 3 11:30 postgresql-2022-06-03_113031.log.gz
-rw-------. 1 root root 418 Jun 3 11:34 postgresql-2022-06-03_113354.log.gz
-rw-------. 1 root root 419 Jun 3 11:39 postgresql-2022-06-03_113920.log.gz
-rw-------. 1 root root 416 Jun 3 11:44 postgresql-2022-06-03_114437.log.gz
-rw-------. 1 root root 417 Jun 3 11:49 postgresql-2022-06-03_114943.log.gz
-rw-------. 1 root root 419 Jun 3 11:55 postgresql-2022-06-03_115530.log.gz
-rw-------. 1 root root 16961 Jun 3 23:56 postgresql-2022-06-03_120047.log.gz
-rw-------. 1 root root 35470 Jun 4 23:56 postgresql-2022-06-04_000000.log.gz
-rw-------. 1 root root 406059 Jun 5 17:56 postgresql-2022-06-05_000000.log
I want to run a small script(unix/linux) such that it creates a symlink in this folder which always points to the latest(current) logfile automatically for e.g
postgres.LOG -> postgresql-2022-06-05_000000.log
This way I don't have to ls and find out what is the current log file before opening, instead just open postgres.LOG.
All rotated logfiles seem gzipped so the glob postgresql-*.log will expand to the logfile of interest:
ln -sf postgresql-*.log postgres.LOG
If you want the symbolic link to be changed automatically each time a new log file is created you need inotify.
Something like this
#! /bin/bash
log_dir=/your/log/dir
inotifywait -m -e create "$log_dir" | while read -r _dir event file
do
if [[ ! -h "$log_dir/$file" && "$file" =~ \.log$ ]]
then
ln -sf "$log_dir/$file" "$log_dir/postgres.LOG"
fi
done
The format of the filename makes sure that the newest file sorts as last using ls. So this should work:
ln -sf $(ls postgresql-*.log | tail -1) postgres.LOG

Command 'scala' not found on Ubuntu 18.04

I downloaded scala,unpacked it and copied to /usr/local/share
After that,I edited ~/.bashrc
export SCALA_HOME=/usr/local/share/scala-2.12.8
export PATH=$PATH:$SCALA_HOME/bin
Anyway,it does not work.
scala -version
Command 'scala' not found, but can be installed with:
sudo apt install scala
I could go for apt install but I don't get it what is wrong.
/usr/local/share$ ll
total 48
drwxr-xr-x 12 root root 4096 јул 1 06:03 ./
drwxr-xr-x 14 root root 4096 јун 23 18:04 ../
drwxr-xr-x 2 root root 4096 апр 21 08:04 appdata/
drwxr-xr-x 2 root root 4096 јун 25 21:03 applications/
drwxr-xr-x 2 root root 4096 јул 25 2018 ca-certificates/
drwxrwsr-x 3 root staff 4096 јул 25 2018 emacs/
drwxrwsr-x 2 root staff 4096 јул 25 2018 fonts/
drwxr-xr-x 3 root root 4096 апр 19 08:44 lua/
drwxr-xr-x 2 root root 4096 јул 25 2018 man/
drwxrwxr-x 6 miki miki 4096 дец 4 2018 scala-2.12.8/
drwxrwsr-x 7 root staff 4096 мај 14 15:05 sgml/
drwxrwsr-x 6 root staff 4096 мај 14 15:05 xml/
Editing .bashrc won't affect an already open shell. You could explicitly source it (source ~/.bashrc) to have it take effect, or open a new shell to reload it.

Mongodb build is huge

I need to build mongodb from source to get SSL support.
I ran the following set of commands as per various sources I could find:
sudo git clone git://github.com/mongodb/mongo.git
cd mongo/
git checkout r2.6.0
sudo git checkout r2.6.0
sudo scons --ssl all
This builds without major issues (although it takes a long time) but the output files are huge:
-rwxr-xr-x 1 root root 361M May 2 12:28 bsondump
-rwxr-xr-x 1 root root 148M May 1 15:07 mongo
-rwxr-xr-x 1 root root 359M May 2 12:54 mongobridge
-rwxr-xr-x 1 root root 365M May 2 10:30 mongod
-rwxr-xr-x 1 root root 362M May 2 11:21 mongodump
-rwxr-xr-x 1 root root 361M May 2 11:40 mongoexport
-rwxr-xr-x 1 root root 362M May 2 12:21 mongofiles
-rwxr-xr-x 1 root root 361M May 2 11:48 mongoimport
-rwxr-xr-x 1 root root 361M May 2 12:13 mongooplog
-rwxr-xr-x 1 root root 358M May 2 12:35 mongoperf
-rwxr-xr-x 1 root root 362M May 2 11:30 mongorestore
-rwxr-xr-x 1 root root 248M May 2 11:07 mongos
-rwxr-xr-x 1 root root 362M May 2 11:57 mongostat
-rwxr-xr-x 1 root root 361M May 2 12:04 mongotop
-rwxr-xr-x 1 root root 361M May 2 12:46 perftest
-rwxr-xr-x 1 root root 455M May 2 14:54 test
Am I missing something here?
The raw build produces binaries that contain the debug symbols and you can get rid of them by using the strip command like this:
strip mongod

custom yum repo not showing rpm

I have a yum repository I've set up where I store custom rpms.
I have no problem finding information about other packages that were built and stored in this custom repo.
#yum --disablerepo=rhui-us-east-rhel-server-1y,epel,epel-testing --enablerepo=customrepo install php53-pecl-xdebug
php53-pecl-xdebug x86_64 2.2.1-2 customrepo 132 k
No problem.
Now I drop somerpm.rpm in centos/repo/5/noarch, run createrepo --update . in this directory and try the same command, and yet it shows no results.
I tried running createrepo --update in the root of the repo as well, but that did not work either (I'm actually not sure where to run it and if it needs a repodata directory in each subdir).
[root#reposerver mnt]# ls -l /var/www/repo/
total 12
-rw-r--r-- 1 root root 203 Jun 8 00:13 REPO_README
drwxr-xr-x 3 root root 4096 Jun 10 2011 centos
drwxr-xr-x 2 root root 4096 Oct 18 20:02 repodata
[root#reposerver mnt]# ls -l /var/www/repo/centos/5/
SRPMS/ i386/ noarch/ repodata/ x86_64/
[root#reposerver mnt]# ls -l /var/www/repo/centos/5/noarch/
total 7324
-rw-r--r-- 1 root root 1622 Jun 28 2011 compat-php-5.1.6-1.noarch.rpm
drwxr-xr-x 2 root root 4096 Oct 18 19:55 repodata
-rw-r--r-- 1 root root 1066928 Oct 18 19:54 salt-0.10.3-1.noarch.rpm
-rw-r--r-- 1 root root 6363197 Oct 18 19:54 salt-0.10.3-1.src.rpm
-rw-r--r-- 1 root root 21822 Oct 18 19:54 salt-master-0.10.3-1.noarch.rpm
-rw-r--r-- 1 root root 14294 Oct 18 19:54 salt-minion-0.10.3-1.noarch.rpm
I also tried adding the exactarch=0 flag to my repo config to ignore arch restrictions and this did not work either, it was a shot in the dark, since my rpm is noarch, it should show regardless.
# cat /etc/yum.repos.d/mycompany.repo
[mycompany]
name=mycompany custom repo
baseurl=http://config/repo/centos/5/$basearch
enabled=1
exactarch=0
I'm at a loss at this point. Usually createrepo --update does the trick, but for some reason it cannot find the new rpms.
repo]# find . -type f -name "*.gz" | xargs zcat | grep salt-minion
returns results as well, so it's definitely in the repo data.
yum clean all on the server I was trying to install on worked.
Also make sure to do createrepo --update on the specific subdir instead of the root of the repo.

Build failed when installing node-postgres module for node.js

I'm very (very) new to node.js, and also fairly green when it comes to server side configuration and coding. (I have a long history of client-side programming, most recently with Adobe Flex and ActionScript.)
Anyhow, I asked Rackspace (who manages a Linux server for me) to install node.js and node-postgres.
From the comments in the ticket, that installation went like this:
node.js
Running Transaction
Installing : nodejs-stable-release [1/1]
Installed: nodejs-stable-release.noarch 0:5-3
Complete!
and node-postgres
[root#237175-web2 src]# npm install pg
npm http GET https://registry.npmjs.org/pg
npm http 200 https://registry.npmjs.org/pg
npm http GET https://registry.npmjs.org/pg/-/pg-0.6.17.tgz
npm http GET https://registry.npmjs.org/generic-pool/1.0.9
npm http 200 https://registry.npmjs.org/generic-pool/1.0.9
npm http GET https://registry.npmjs.org/generic-pool/-/generic-pool-1.0.9.tgz
pg#0.6.17 install /usr/src/node_modules/pg
node-waf configure build || (exit 0)
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /usr
Checking for program pg_config : /usr/bin/pg_config
'configure' finished successfully (0.051s)
Waf: Entering directory `/usr/src/node_modules/pg/build'
[1/2] cxx: src/binding.cc -> build/Release/src/binding_1.o
[2/2] cxx_link: build/Release/src/binding_1.o -> build/Release/binding.node
Waf: Leaving directory `/usr/src/node_modules/pg/build'
'build' finished successfully (0.745s)
pg#0.6.17 ./node_modules/pg
+-- generic-pool#1.0.9
More info:
[root#237175-web2 ~]# ls -la /usr/src/node_modules/pg
total 68
drwxr-xr-x 9 root root 4096 Apr 26 22:34 .
drwxr-xr-x 3 root root 4096 Apr 26 22:34 ..
drwxr-xr-x 2 root root 4096 Apr 26 22:34 benchmark
drwxr-xr-x 4 root root 4096 Apr 26 22:34 build
drwxr-xr-x 3 root root 4096 Apr 26 22:34 lib
-rw-r--r-- 1 root root 5618 Apr 26 22:34 .lock-wscript
-rw-r--r-- 1 root root 1269 Feb 23 23:58 Makefile
drwxr-xr-x 3 root root 4096 Apr 26 22:34 node_modules
-rw-r--r-- 1 root root 21 Mar 3 15:19 .npmignore
-rw-r--r-- 1 root root 962 Apr 26 22:34 package.json
-rw-r--r-- 1 root root 6843 Mar 27 09:30 README.md
drwxr-xr-x 2 root root 4096 Apr 26 22:34 script
drwxr-xr-x 2 root root 4096 Mar 21 23:37 src
drwxr-xr-x 5 root root 4096 Apr 26 22:34 test
-rw-r--r-- 1 root root 990 Feb 23 23:58 wscript
[root#237175-web2 ~]#
A little “Hello world” node.js example works fine (hooray!), but a simple Postgres example fails on the require('pg') statement, saying that the module cannot be found. I've looked on the server and can't find a pg.js file anywhere.
Any clue as to why the node-postgres build failed?
Install it globally:
npm install -g pg
You may need to become root, e.g. with
sudo npm install -g pg