2

I'm working on a project that requires I start a GUI before the login prompt. I had this working under 12.10, but today I migrated to 14.04 and it's breaking stuff. At this point I've configured Grub to boot in text mode and I've written a script S99StartProgram in the /etc/init.d directory that is being placed as in /etc/rcS.d after I run:

update-rc.d StartProgram start 99 S .

My header at the top of the script is:

### BEGIN INIT INFO
# Provides:             VTTI_StartProgram
# X-Start-Before:       x11-common
# Required-Start:       $remote_fs $network $syslog $sshd
# Required-Stop:        $remote_fs $network $syslog $sshd
# Default-Start:        S
# Default-Stop:
# Short-Description:    Start Software at Boot Time
# Description:          Debian init Script to Start Software at Boot Time
### END INIT INFO

The script seems to be working, however, it's not starting after sshd which means I'm being blocked from SSHing into the system once the programs XSession starts. I tried running:

service --status-all

and that provided me with the output:

[ + ] acpid [ - ] anacron [ - ] apparmor [ ? ] apport [ - ] avahi-daemon [ + ] bluetooth [ - ] brltty [ ? ] console-setup [ + ] cron [ + ] cups [ + ] cups-browsed [ - ] dbus [ ? ] dns-clean [ + ] friendly-recovery [ - ] grub-common [ ? ] irqbalance [ + ] kerneloops [ ? ] killprocs [ ? ] kmod [ ? ] lightdm [ ? ] networking [ ? ] ondemand [ ? ] pppd-dns [ - ] procps [ - ] pulseaudio [ ? ] rc.local [ + ] resolvconf [ - ] rsync [ + ] rsyslog [ + ] saned [ ? ] screen-cleanup [ ? ] sendsigs [ ? ] speech-dispatcher [ - ] ssh [ - ] sudo [ - ] udev [ ? ] umountfs [ ? ] umountnfs.sh [ ? ] umountroot [ - ] unattended-upgrades [ - ] urandom [ - ] x11-common

I also tried running:

service ssh stop

and I'm still able to ssh into the device.

The only other boot system I've encountered is systemd, but from what I've read (even though there are tons of systemd directories on Ubuntu) Ubuntu doesn't use systemd out of the box.

Can someone please explain to me what is going on? Where is sshd being run from? And how do I make my script wait till after it's done?

Thanks in advance!!

3
  • Are you trying to SSH in into your own system? If so, why? If not, you don't need sshd to be running, as that service is for others connecting into your own computer. Jul 16, 2014 at 21:13
  • How does systemd come into the picture? Are you saying you want to write an upstart file instead of an old school init script?
    – muru
    Jul 17, 2014 at 2:02
  • The system is installed in a car. There will be no keyboard/mouse, so ssh through a wireless router is the primary means of connection. So ssh is definitely a requirement. I don't care what system is used, as long as it has the desired effect; preferably the solution involves tools that come with Ubuntu rather than trying to download something else. Jul 17, 2014 at 2:13

1 Answer 1

1

The init.d scripts combined with update-rc.d were unsuccessful in rendering my desired system behavior. I ended up learning more about UpStart, which seems to be the primary method for starting programs on Ubuntu.

I created this script in /etc/init as start_program.conf:

description "Start Program"
author      "Anonymous"

start on started JOB=ssh    

script
    ifconfig can0 up
    exec /full/path/to/program &
end script

I then just needed to run the command:

initctl reload-configuration

And after a reboot everything worked as I had desired in my initial post.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .