rc.d scripting problem

If I run sh /usr/local/etc/rc.d/kodi

I get Usage: ******* [start|stop| etc]

If I run sh /usr/local/etc/rc.d/kodi start
it works the way I want, as if I can xinit kodi from the command prompt.

I can't figure how to make it start explicitly.
 
If I run sh /usr/local/etc/rc.d/kodi start
it works the way I want, as if I can xinit kodi from the command prompt.

I can't figure how to make it start explicitly.

You do have kodi_enable="YES" in /etc/rc.conf ?

If so, have you tried using the full path to xinit in command, noting that $PATH in the rc environment is likely minimal?
 
But this doesn't work. What have I overlooked?
The rc(8) script in this form is executed as one of the first, before the file system is mounted. Check rcorder /etc/rc.d/* /usr/local/etc/rc.d/* and dmesg(8).

Try to set # REQUIRE: LOGIN to start the kodi service after most of everything else. Check with rcorder /etc/rc.d/* /usr/local/etc/rc.d/* after editing.

From /etc/rc.d/LOGIN:
Code:
#        This is a dummy dependency to ensure user services such as xdm,
        ... are started after everything else, ...

Note: If not done yet, the custom script should be placed under /usr/local/etc/rc.d to not mix with base system scripts.

But, I believe kodi executed from the present script won't work as developed without running as a user. Kodi wants to read and save configuration files, read/write a database, in a permissions granted directory/subdirectories (normaly a users home directory). Not sure how this can be accomplished from a rc(8) script.

I think the best aproache would be to autologin a user and execute xorg from the users login shell configuration file and kodi from ~/.xinitrc.
 
I haven't managed to get an rc.d script working so am looking for alternatives.

Is there a simpler way to run startx automatically on startup?
 
That is one of Warrens best posts. I use that method with kiosk appliance.
Openbox has its own application startup file.
/user/.config/openbox/autostart
 
I just added xinit kodi to the end of /root/.cshrc
Never run X as root, run as a normal user. For Example:

Create a user (kodi), choose csh(1) as login shell, edit /etc/gettytab:
Code:
A|Al|Autologin console:\
        :ht:np:sp#115200:al=kodi

Edit /etc/ttys:
Code:
ttyv1 "/usr/libexec/getty Al" xterm on secure

Edit /usr/home/kodi/.cshrc
 
Back
Top