Cannot start AEM as a service on Ubuntu 18.04 - shell

I'm trying to setup AEM (Adobe Experience Manager) Author as a Service on Ubuntu 18.04 on an AWS EC2 instance.
Script file "aem" at /usr/bin/aem (file permissions to "root")
#!/bin/bash
#
# description: This service manages the Adobe Experience Manager java process.
# processname: aem6
. /lib/lsb/init-functions
SCRIPT_NAME=`basename $0`
AEM_ROOT=/opt/aem/author
AEM_USER=root
########
BIN=${AEM_ROOT}/crx-quickstart/bin
START=${BIN}/start
STOP=${BIN}/stop
STATUS=${BIN}/status
case "$1" in
start)
if [ -f $START ]; then
echo "Starting AEM Service.."
/bin/su -l $AEM_USER -c $START
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/${SCRIPT_NAME}
fi
;;
stop)
if [ -f $STOP ]; then
echo "Stopping AEM Service.."
/bin/su -l $AEM_USER -c $STOP
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/${SCRIPT_NAME}
fi
;;
status)
if [ -f $STATUS ]; then
echo -s "Checking status of $SCRIPT_NAME: "
/bin/su -l $AEM_USER -c $STATUS
RETVAL=$?
[ $RETVAL -eq 0 ] && echo "$SCRIPT_NAME is running"
fi
;;
restart)
/bin/su -l ${AEM_USER} -c ${STOP}
/bin/su -l ${AEM_USER} -c ${START}
;;
reload)
;;
*)
echo "Usage: $0 {start|stop|status|reload}"
RETVAL=1
;;
esac
exit $RETVAL
Service file at /etc/systemd/system/aem.service (file permissions to "root")
[Unit]
Description=Adobe Experience Manager
[Service]
Type=simple
ExecStart=/usr/bin/aem start
ExecStop=/usr/bin/aem stop
ExecReload=/usr/bin/aem restart
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
when checking the service status:
ubuntu#ip-109:~$ sudo systemctl status aem
aem.service - Adobe Experience Manager
Loaded: loaded (/etc/systemd/system/aem.service; enabled; vendor preset: enabled)
Active: active (exited) since Wed 2019-10-23 20:25:21 UTC; 3min 24s ago
Process: 20106 ExecStart=/usr/bin/aem start (code=exited, status=0/SUCCESS)
Main PID: 20106 (code=exited, status=0/SUCCESS)
Oct 23 20:25:21 ip-172-31-14-109 systemd[1]: Started Adobe Experience Manager.
Oct 23 20:25:21 ip-172-31-14-109 aem[20106]: Starting AEM Service..
Oct 23 20:25:21 ip-172-31-14-109 su[20122]: Successful su for root by root
Oct 23 20:25:21 ip-172-31-14-109 su[20122]: + ??? root:root
Oct 23 20:25:21 ip-172-31-14-109 su[20122]: pam_unix(su:session): session opened for user root by (uid=0)
Oct 23 20:25:21 ip-172-31-14-109 aem[20106]: mesg: ttyname failed: Inappropriate ioctl for device
Oct 23 20:25:21 ip-172-31-14-109 su[20122]: pam_unix(su:session): session closed for user root
But cannot see "java" process (using ps -ef | grep java ) or port "4502" being used (using sudo lsof -i -P -n | grep LISTEN).
What am i missing?

Was able to resolve the issue. The problem was with "java" not being available to all users. Installed Oracle Java using default (ubuntu) user, while the aem script was running as root.
Steps to install custom Java.. not the Ubuntu default:
Download the tar.gz file "https://download.oracle.com/otn/java/jdk/8u231-b11/5b13a193868b4bf28bcb45c792fce896/jdk-8u 231-linux-x64.tar.gz"
Copy the file to the server using SCP
Make a directory mkdir /opt/java
Install and copy sudo tar -zxf jdk-8u231-linux-x64.tar.gz -C /opt/java/
Update your environment to allow Java for all users. Run this command
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.8.0_231/bin/java 1
Add path to ".bashrc". Open to edit sudo nano ~/.bashrc
Add these lines to the end of the file:
export JAVA_HOME=/opt/java/jdk1.8.0_231
export PATH=${PATH}:${JAVA_HOME}/bin
After this.. start the "aem" service again. It should be working!

Related

"ssh -q" pbrun exec last login still showing up even with .hushlogin

I'm running the below script on RHEL 7.9 and after connecting to the remote machine and execing pbrun, the last login message is getting displayed and sometimes it interferes with the command which is forcing me to do many more steps than necessary and it's just downright frustrating.
As I stated in the subject, I have tried this with "ssh -q" as well as with "ssh -q" AND a .hushlogin file in both my home directory as well as root's home.
I'm sure it has to do with the switching of users, but I can't figure out how to get rid of the last login message. **** MODIFYING SYSTEM FILES IS OUT OF THE QUESTION ****
There appears to be another issue when trying to remove a file, it's the "CASCU050E Failed to send data (Reason=[send failed], Rc=[111])." errors in the below output.
Any help greatly appreciated!
Thanks
Here's the script:
if [ "$#" -ne 2 ]; then
echo "You must enter exactly 2 command line arguments"
echo "argument 1 = file containing all hosts to test, one fqdn per line."
echo "argument 2 = full path to output file."
exit 1
fi
echo 'Please enter your AD passord for API authentication'
echo -n "Password: "
read -s passy
echo ""
sshpass="sshpass -p$passy ssh -q -oStrictHostKeyChecking=no"
scppass="sshpass -p$passy scp -r -q -oStrictHostKeyChecking=no"
hosts=$(cat $1)
IAM=$(whoami)
echo "*** Moving existing /tmp/perf directories out of the way. ***"
for HOST in $hosts; do
if ($sshpass $HOST ps waux | grep run-fio-tests | grep -v grep >/dev/null 2>&1)
then
echo "*** fio test is currently running on host $HOST, STOPPING THE FIO RUN. ***"
break
fi
#####
#Tried with the two following lines uncommented, no change in behavior.
#####
# $sshpass $HOST "touch .hushlogin"
# $sshpass $HOST "echo touch .hushlogin | exec pbrun /bin/su -"
dirs=$($sshpass $HOST "ls /tmp/| grep -i ^perf" | grep -v .tgz)
for dir in $dirs; do
echo "Moving existing /tmp/$dir directory to /tmp/$dir.`date +%Y%m%d-%H%M`.tgz on $HOST"
$sshpass $HOST "tar czf /tmp/$dir.`date +%Y%m%d-%H%M`.tgz -P /tmp/$dir 2>/dev/null"
$sshpass $HOST "echo chown -R $IAM /tmp/perf | pbrun /bin/su -"
$sshpass $HOST "rm -rf /tmp/$dir"
done
done
for HOST in $hosts; do
echo "*** Cleaning up on $HOST ***"
$sshpass $HOST "echo rm -rf /tmp/data/randread-raw-data-5G /tmp/data/seqread-raw-data-32G /tmp/data/seqwrite-raw-data-5G | exec pbrun /bin/su -"
$sshpass $HOST "echo rm -rf /tmp/RUNFIO.sh | exec pbrun /bin/su -"
done
Here are the errors i'm getting:
Please enter your AD passord for API authentication
Password:
*** Moving existing /tmp/perf directories out of the way. ***
Last login: Fri Aug 6 22:51:55 MST 2021
Moving existing /tmp/perf directory to /tmp/perf.20210806-2255.tgz on host1.acme.com
Last login: Fri Aug 6 22:55:38 MST 2021
*** End Moving old perfs. ***
*** Cleaning up on host1.acme.com ***
CASCU050E Failed to send data (Reason=[send failed], Rc=[111]).
CASCU050E Failed to send data (Reason=[send failed], Rc=[111]).
CASCU050E Failed to send data (Reason=[send failed], Rc=[111]).
CASCU050E Failed to send data (Reason=[send failed], Rc=[111]).
CASCU050E Failed to send data (Reason=[send failed], Rc=[111]).
Last login: Fri Aug 6 22:55:45 MST 2021

Softether VPN Setup: Automatic Script executed from git

Am kind of new to bash scripting but i was wondering if it is possible to create automatic installations script for softether vpn server on raspberry pi to be executed from git and if it is possible how do you create one as I cant find any of the tutorial online to implement what i want, I tried to create mine and I failed miserably. any help will be appreciated.Thanks
sudo su
cd /root/
wget https://www.softether-download.com/files/softether/v4.34-9745-rtm-2020.04.05-tree/Linux/SoftEther_VPN_Server/32bit_-_ARM_EABI/softether-vpnserver-v4.34-9745-rtm-2020.04.05-linux-arm_eabi-32bit.tar.gz
tar xzf softether-vpnserver-v4.34-9745-rtm-2020.04.05-linux-arm_eabi-32bit.tar.gz && rm softether-vpnserver-v4.34-9745-rtm-2020.04.05-linux-arm_eabi-32bit.tar.gz
cd vpnserver && sudo make
cd ..
sudo mv vpnserver /usr/local && cd /usr/local/vpnserver/
sudo chmod 600 *
sudo chmod 700 vpnserver vpncmd
sudo ./vpnserver start
sudo ./vpncmd
ServerPasswordSet
echo net.ipv4.ip_forward = 1 | ${SUDO} tee -a /etc/sysctl.conf
echo net.ipv6.ip_forward = 1 | ${SUDO} tee -a /etc/sysctl.conf
sudo cat >> /etc/init.d/vpnserver << EOF
#!/bin/sh
### BEGIN INIT INFO
# Provides: vpnserver
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: SoftEther VPN 1.0 RC2
# Description: Start vpnserver daemon SoftEther VPN 1.0 Server
### END INIT INFO
DAEMON=/usr/local/vpnserver/vpnserver
LOCK=/var/lock/vpnserver
. /lib/lsb/init-functions
test -x $DAEMON || exit 0
case "$1" in
start)
sleep 3
log_daemon_msg "Starting SoftEther VPN 1.0 Server" "vpnserver"
$DAEMON start >/dev/null 2>&1
touch $LOCK
log_end_msg 0
sleep 3
;;
stop)
log_daemon_msg "Stopping SoftEther VPN 1.0 Server" "vpnserver"
$DAEMON stop >/dev/null 2>&1
rm $LOCK
log_end_msg 0
sleep 2
;;
restart)
$DAEMON stop
sleep 2
$DAEMON start
sleep 5
;;
status)
if [ -e $LOCK ]
then
echo "vpnserver is running."
else
echo "vpnserver is not running."
fi
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit 0
EOF
sudo chmod 755 /etc/init.d/vpnserver
sudo update-rc.d vpnserver defaults
systemctl enable vpnserver
sudo /etc/init.d/vpnserver start
sudo /etc/init.d/vpnserver stop
sudo /etc/init.d/vpnserver restart
wget -qO- https://ipecho.net/plain ; echo

How to wait for postgres startup in ENTRYPOINT?

What would be the best approach to wait for postgres to fully start up inside my ENTRYPOINT before moving on executing nosetests?
Right now I've timed the startup on my machine to around 50 seconds. So I'm just sleeping for 60 seconds. This does not feel good as this might not work when being run on another machine.
ENTRYPOINT \
runuser -l postgres -c '/usr/lib/postgresql/9.3/bin/postgres -D /var/lib/postgresql/9.3/main -c config_file=/etc/postgresql/9.3/main/postgresql.conf & ' && \
sleep 60 && \
nosetests --verbose --cover-erase --with-coverage --cover-package=stalker
This is the output of starting up postgres:
2017-02-13 13:46:49.541 UTC [9] LOG: database system was interrupted; last known up at 2017-02-13 12:53:23 UTC
2017-02-13 13:47:37.951 UTC [9] LOG: database system was not properly shut down; automatic recovery in progress
2017-02-13 13:47:37.994 UTC [9] LOG: redo starts at 0/1783EA0
2017-02-13 13:47:37.995 UTC [9] LOG: record with zero length at 0/17841E8
2017-02-13 13:47:37.995 UTC [9] LOG: redo done at 0/17841B8
2017-02-13 13:47:37.995 UTC [9] LOG: last completed transaction was at log time 2017-02-13 12:53:23.731984+00
2017-02-13 13:47:38.384 UTC [9] LOG: MultiXact member wraparound protections are now enabled
2017-02-13 13:47:38.387 UTC [7] LOG: database system is ready to accept connections
2017-02-13 13:47:38.387 UTC [13] LOG: autovacuum launcher started
Please, I do understand that this goes against the convention of running multiple commands in ENTRYPOINT. I have good reasons to do this in this case.
Thanks to #zeppelin for suggesting pg_isready. I ended up using this:
#!/bin/bash
# wait-for-postgres.sh
set -e
cmd="$#"
timer="5"
until runuser -l postgres -c 'pg_isready' 2>/dev/null; do
>&2 echo "Postgres is unavailable - sleeping for $timer seconds"
sleep $timer
done
>&2 echo "Postgres is up - executing command"
exec $cmd
I'm using this in my ENTRYPOINT:
ENTRYPOINT \
# Start PostgreSQL
runuser -l postgres -c '/usr/lib/postgresql/9.3/bin/postgres -D /var/lib/postgresql/9.3/main -c config_file=/etc/postgresql/9.3/main/postgresql.conf & ' && \
# Exectute tests when db is up
./wait-for-postgres.sh nosetests --verbose --cover-erase --with-coverage --cover-package=stalker
I will normally use a small "tcp-port-wait" script, like this:
#!/bin/bash
set -e
if [ -z "$1" -o -z "$2" ]
then
echo "tcp-port-wait - block until specified TCP port becomes available"
echo "Usage: ntcp-port-wait HOST PORT"
exit 1
fi
echo Waiting for port $1:$2 to become available...
while ! nc -z $1 $2 2>/dev/null
do
let elapsed=elapsed+1
if [ "$elapsed" -gt 90 ]
then
echo "TIMED OUT !"
exit 1
fi
sleep 1;
done
echo "READY !"
To wait until a certain service is up and ready.
In case of Postgresql, the default port it will listen on is 5432, so the command would be:
tcp-port-wait localhost 5432
That will block until Postgresql service is ready to serve connections, on :5432 on the loopback interface inside the container (when run in context of the ENTRYPOINT script).
You certainly have to copy this script into your container,
by adding a line like that to your Dockerfile:
COPY tcp-port-wait /usr/local/bin/
before you can use it.
And also install the netcat utility.
You can use this for other types of services, like Tomcat or Mysql, too.
And, if you need, you can also wait "outside the container", like this:
docker exec my_container tcp-port-wait localhost 5432
Note, there are certainly other ways to do this, e.g. by using some orchestration tool, like docker-compose with healthcheck directive, or some process manager inside the container itself.

Fedora 25 Tigervnc displays Black screen

The system is Fedora 25. The issue is vncviewer is displaying a black screen. By comparison the vnc package list is the same as those in a Fedora 24 system where vnc viewer is displaying correctly.The same client system is used to access the server.
Other threads with this issue have been reviewed and tried, specifically vnc package requirements, $HOME//.vnc/xstartup permissions, and suggestions for the xstartup script.
Below is the xstartup script:
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec gnome-session
# --session=gnome-fallback
# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
startx &
Below is the output from systemctl status vncserver:
vncserver#:2.service - Remote desktop service (VNC)
Loaded: loaded (/etc/systemd/system/vncserver#:2.service; enabled; vendor
preset: disabled)
Active: active (running) since Fri 2017-01-13 07:05:58 PST; 1h 18min ago
Process: 25119 ExecStop=/usr/bin/vncserver -kill %i (code=exited,
status=0/SUCCESS)
Process: 25152 ExecStart=/usr/bin/vncserver %i (code=exited,
status=0/SUCCESS)
Process: 25147 ExecStartPre=/usr/bin/vncserver -kill %i (code=exited,
status=2)
Main PID: 25161 (Xvnc)
Tasks: 186 (limit: 4915)
CGroup: /system.slice/system-vncserver.slice/vncserver#:2.service
├─25161 /usr/bin/Xvnc :2 -auth /home/dan/.Xauthority -desktop server:2
(dan) -fp catalogue:/etc/X11/fontpath.d -geometry 1024x
├─25168 /usr/bin/vncconfig -nowin
├─25170 /usr/libexec/gnome-session-binary
├─25177 dbus-launch --autolaunch 98c684d1ace64647a9df44e5b61d8590 --
binary-syntax --close-stderr
├─25178 /usr/bin/dbus-daemon --syslog-only --fork --print-pid 5 --
print-address 7 --session
├─25182 dbus-launch --exit-with-session /usr/libexec/gnome-session binary
├─25183 /usr/bin/dbus-daemon --syslog --fork --print-pid 5 --print-
address 7 --session
├─25191 /usr/libexec/at-spi-bus-launcher
├─25196 /bin/dbus-daemon --config-file=/usr/share/defaults/at-
spi2/accessibility.conf --nofork --print-address 3
├─25199 /usr/libexec/at-spi2-registryd --use-gnome-session
├─25203 /usr/libexec/gvfsd
├─25222 /usr/bin/gnome-keyring-daemon --start --components=secrets
├─25242 /usr/libexec/gnome-settings-daemon
├─25252 /usr/bin/pulseaudio --start --log-target=syslog
├─25296 /usr/libexec/tracker-extract
├─25301 /usr/libexec/tracker-store
├─25318 /usr/libexec/tracker-miner-apps
├─25320 /usr/libexec/evolution/evolution-alarm-notify
├─25324 /usr/libexec/deja-dup/deja-dup-monitor
├─25329 /usr/libexec/gsd-printer
├─25335 /usr/libexec/imsettings-daemon
├─25336 /usr/libexec/tracker-miner-user-guides
├─25378 abrt-applet
├─25418 /usr/libexec/tracker-miner-fs
├─25438 /usr/libexec/gvfs-udisks2-volume-monitor
├─25462 /usr/bin/seapplet
├─25529 /usr/libexec/gvfs-gphoto2-volume-monitor
├─25559 /usr/bin/ibus-daemon -r --xim
There were several threads a few years back. Those have been reviewed and tried. They do not seem applicable to this situation.
You can find an answer here: https://www.server-world.info/en/note?os=Fedora_25&p=desktop&f=6 - on my case the replacement at /home/USER/.vnc/xstartup
...
# end line: comment out and add like follows
#exec /etc/X11/xinit/xinitrc
#exec /usr/bin/mate-session
exec /usr/bin/gnome-session
so I used gnome-session instead of mate-session as I am using gnome-desktop.
No more blank screen (wait some time until transmitted).
I am using Fedora 27 and having the same issue "Black Screen". I tried a lot of 'workaround', none of them works for me. then I switched to use MATE desktop environment, and got it working in seconds. if you had struggled with the issue for a long time, i would suggest to try MATE desktop.
if you don't have MATE installed, you should install MATE:
dnf -y group install "MATE Desktop"
here is the help of installing MATE.
update xstartup as follows.
#!/bin/sh
#def
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec /usr/bin/mate-session
remember to restart VNC service, it should work.
#systemctl start vncserver#:1.service
Hope it helps somebody.
I also had the issue in F25 with gnome. I just modified the xstartup like the following, and it started working well:
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec gnome-session
#exec /etc/X11/xinit/xinitrc
what about to add a config for xstartup in ~/.vcn/
!/bin/sh
#
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
# exec /etc/X11/xinit/xinitrc
#
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &

How to run some programs which require `source ~/.bashrc` and to be launched inside tmux with upstart?

I have some programs which require source ~/.bashrc and should be launched inside tmux with upstart.
So I've wrote the following test programs and it works when I manually start these daemons by initctl start xxx, but it doesn't at boot-time.
I'm using Ubuntu 12.04.
Does anyone have a solution?
test programs
3 test conf scripts
eisoku#server:~$ cat /etc/init/start-tmux.conf
description "tmux daemon"
start on started network-manager
stop on runlevel [!2345]
umask 022
nice -5
script
sudo -iu eisoku /bin/bash -i -c 'source ~/.bashrc && bash ~/Desktop/util/start-tmux.bash' &
watch -n 100 ls
end script
eisoku#server:~$ cat /etc/init/test-a.conf
description "test a daemon"
start on started start-tmux
stop on stopped start-tmux
umask 022
script
sudo -iu eisoku /bin/bash -i -c "source ~/Desktop/util/tmux-patch.bash && tmux-newwindow test-a htop" &
watch -n 100 ls
end script
eisoku#server:~$ cat /etc/init/test-b.conf
description "test b daemon"
start on started start-tmux
stop on stopped start-tmux
umask 022
script
sudo -iu eisoku /bin/bash -i -c "source ~/Desktop/util/tmux-patch.bash && tmux-newwindow test-b top" &
watch -n 100 ls
end script
util scripts
eisoku#server:~$ cat ~/Desktop/util/start-tmux.bash
#!/bin/bash
SESSION_NAME=`hostname`
tmux new-session -d -s $SESSION_NAME -n tmp
eisoku#server:~$ cat ~/Desktop/util/tmux-patch.bash
#!/bin/bash
tmux-newwindow() {
if [ `tmux list-windows | grep " $1 " | cut -d' ' -f2` ]; then
echo $1 "already exists"
else
tmux new-window -k -n $1 -t `hostname`
tmux send-keys -t `hostname`:$1 ${#:2} C-m
fi
}
tmux-killwindow() {
if [ `tmux list-windows | grep " $1 " | cut -d' ' -f2` ]; then
tmux kill-window -t $1
else
echo $i "not exists"
fi
}
result
eisoku#local-PC:~$ ssh eisoku#server
Welcome to Ubuntu 12.04.5 LTS (GNU/Linux 3.11.0-26-generic x86_64)
eisoku#server:~$ sudo reboot
After reboot,
eisoku#local-PC:~$ ssh eisoku#server
Welcome to Ubuntu 12.04.5 LTS (GNU/Linux 3.11.0-26-generic x86_64)
eisoku#server:~$ tmux list-windows
0: tmp [80x23] [layout b85e,80x23,0,0] (active)
eisoku#server:~$
eisoku#server:~$ initctl status start-tmux
start-tmux start/running, process 1030
eisoku#server:~$ initctl status test-a
test-a start/running, process 1033
eisoku#server:~$ initctl status test-b
test-b start/running, process 1031
test-a and test-b seem not to be worked as I had expected while the status of the daemons is running.
However, it works when I manually start these daemons
eisoku#server:~$ sudo initctl restart test-a
test-a start/running, process 3369
eisoku#server:~$ sudo initctl restart test-b
test-b start/running, process 3461
eisoku#server:~$ tmux list-windows
0: tmp [80x23] [layout b85e,80x23,0,0]
1: test-a [80x23] [layout b85e,80x23,0,0]
2: test-b [80x23] [layout b85e,80x23,0,0] (active)
I've solved my own problem. It is because Upstart run jobs in parallel and Upstart tries to start test-a job just after upstart starts start-tmux job so that tmux, which is launched by start-tmux job in this case, is not completely launched.
I can solve it by using pre-start to wait for tmux to be launched and letting test-b job chain to test-a like this.
eisoku#server:~$ cat /etc/init/test-a.conf
description "test a daemon"
start on started start-tmux
stop on stopped start-tmux
umask 022
pre-start script
/bin/sleep 1
end script
script
sudo -iu eisoku /bin/bash -i -c "source ~/Desktop/util/tmux-patch.bash && tmux-newwindow test-a htop" &
watch -n 100 ls
end script
eisoku#server:~$ cat /etc/init/test-b.conf
description "test b daemon"
start on started test-a
stop on stopped start-tmux
umask 022
pre-start script
/bin/sleep 1
end script
script
sudo -iu eisoku /bin/bash -i -c "source ~/Desktop/util/tmux-patch.bash && tmux-newwindow test-b top" &
watch -n 100 ls
end script

Resources