Init script Doest working Help

This is the place for software discussions not having a dedicated subforum

Init script Doest working Help

Postby Must_ba » Sat May 06, 2017 11:27 am

Hello Guys;

I need to write some init scripts about serial port in my project . I researched related post in forums but I get some problem about it.

I m using embedded linux , so I am using chkconfig for adding scripts to system.

Code: Select all
### BEGIN INIT INFO
# Provides: myservice
# Required-Start:     $local_fs $remove_fs
# Required-Stop:      $local_fs $remove_fs
# Default-Start:      2 3 4 5
# Default-Stop:       0 1
# Short-Description:  myservice
# Description:        giving chmod o+rw /dev/ttymxc0 permission
### END INIT INFO
. /etc/init.d/functions

case "$1" in
  start)
        chmod o+rw /dev/ttymxc0
        ;;
  stop)
       echo -n "My service is stopped"
       ;;
  *)
       exit 1
esac

exit 0


I m saving and
Code: Select all
chkconfig --add init.sh
chkconfig init.sh on

then I m giving chmod +x init.sh permission to my script too.

After I restart my development board I check the permission of my serialport like;
Code: Select all
ls -la /dev/ttymxc0

and There is nothing changed .
My init script doesnt work . Am I missing something? Or Am I doing wrong ?
Can you help me about that.

Thanks
Best Regards
Must_ba
 
Posts: 22
Joined: Thu Jan 19, 2017 11:07 pm

Return to Software - General

Who is online

Users browsing this forum: No registered users and 7 guests

cron