LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Closed Thread
  Search this Thread
Old 05-06-2017, 05:51 AM   #1
Must_ba
LQ Newbie
 
Registered: May 2017
Posts: 9

Rep: Reputation: Disabled
Question Init script Problem


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:
### 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:
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:
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
 
Old 05-06-2017, 06:33 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,605

Rep: Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165
Duplicate thread.

Continue here:
http://www.linuxquestions.org/questi...em-4175605362/
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Init script Problem Must_ba Linux - Software 11 05-08-2017 07:02 AM
Problem with init script and screen d3249 Linux - General 2 08-27-2014 02:08 PM
[SOLVED] why init script cannot source init tools unless session root linuxecho Linux - Newbie 8 02-17-2014 05:17 PM
Init script problem danaketh Debian 5 03-11-2008 08:16 AM
Problem with init script for openssh kaplan71 Linux - Networking 1 04-28-2004 01:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration