lundi 2 février 2015

execute chmod on boot time on headless debian


I am programming a (web based) POS system, dedicated to be running on a debian based ITX-server with apache2 etc. Currently I am using Lubuntu 14.04 LTS for development (and for the 1st customer) with no login on boot up. To open the cash drawer programatically independent from a receipt printer, I am using a small chinese :-) USB-to-serial adapter, which I am speaking with using these commands:



sudo chmod 777 /dev/ttyUSB0


and



echo -en '1' > /dev/ttyUSB0


which works great, and on the FIRST try. Trial and NO error !


Since I experienced, that it doesn't work anymore after next reboot, until I set the chmod again, I added the local user to sudoers and granted him /bin/chmod with NOPASSWD, and put the chmod command in rc.local


Good so far. Now it works seamless after each boot or reboot.


NOW the question: What I need to do, to get the same result later, when the debian webserver will have no GUI and runs without login ? Whom is to be granted the chmod command, and where should I put the chmod command, if not in rc.local ?


Thanks for answer(s).



Aucun commentaire:

Enregistrer un commentaire