Re: rc.local lpadmin

2018-09-09 Thread Louis Garcia
Part of the script did work, that confused me. I found the cause, selinux. When /etc/rc.d/rc.local is created the file gets it permission from the directory its in. In this case etc_t, I saw other init files had initrc_exec_t so I changed rc.local to initrc.exec_t and it worked. On Sun, Sep 9, 201

Re: rc.local lpadmin

2018-09-09 Thread Earl A Ramirez
> That is unnecessary as it is a "static" service. Check the note in > /lib/systemd/system/rc-local.service > > # This unit gets pulled automatically into multi-user.target by > # systemd-rc-local-generator if /etc/rc.d/rc.local is executable. > > I stand corrected :) -- Kind Regards Earl Ramirez

Re: rc.local lpadmin

2018-09-09 Thread Louis Garcia
I just found this: I get permission denied. I thought it would run as root. Is this an selinux problem? $systemctl status rc-local ● rc-local.service - /etc/rc.d/rc.local Compatibility Loaded: loaded (/usr/lib/systemd/system/rc-local.service; enabled-runtime; vendor preset: disabled) Active:

Re: rc.local lpadmin

2018-09-09 Thread Ed Greshko
On 9/10/18 9:33 AM, Earl A Ramirez wrote: > Why does that command not want to work in a startup script?  Is the boot > environment different? > > By default rc-local is not running; therefore, you will need to enable the > server > # systemctl enable rc-local That is unnecessary as it is a "stat

Re: rc.local lpadmin

2018-09-09 Thread Earl A Ramirez
Why does that command not want to work in a startup script? Is the boot environment different? By default rc-local is not running; therefore, you will need to enable the server # systemctl enable rc-local When you reboot your box the script will execute as long as the execute bit is on # chmod +x

Re: rc.local lpadmin

2018-09-09 Thread Ed Greshko
On 9/10/18 9:07 AM, Louis Garcia wrote: > I would like to add a printer at system startup if one is not present. > > I created /etc/rc.d/rc.local and made the file executable > > if [ ! -f "/etc/cups/ppd/Officejet-6700.ppd" ]; then >   /sbin/lpadmin -p Officejet-6700 -o printer-is-shared=false -L "

rc.local lpadmin

2018-09-09 Thread Louis Garcia
I would like to add a printer at system startup if one is not present. I created /etc/rc.d/rc.local and made the file executable if [ ! -f "/etc/cups/ppd/Officejet-6700.ppd" ]; then /sbin/lpadmin -p Officejet-6700 -o printer-is-shared=false -L "Office" -E -v hp:/net/Officejet_6700?ip=172.16.0.2