Debian boot logon network Startup Script

Source: Internet
Author: User
Debian boot logon network boot script-general Linux technology-Linux programming and kernel information. The following is a detailed description. Just now, with the help of Debian, we solved the problem of logon to the Internet at startup. Because we use an authentication software for the education network login in our school, there is no corresponding software under Linux. the login software I use is mystar (which should be developed by some people ), however, this mystar only starts, and does not judge to start repeatedly. There is no background mode to read the configuration file mystar. the conf file must be in the current directory. It is very troublesome, so it has never been done.

Recently, when I read the Debian reference manual, I finally learned how to place the Debian STARTUP script. /Etc/init. d is where all scripts are placed, and then/rc ?. D/The following is the actual start point, all are links to the scripts under/etc/init. d. According to the explanation of/etc/init. d/README, I downloaded the Debian-Policy package and checked the script writing method (9.3 System run levels and init. d scripts) in init. d ). It is important to implement start, stop, restart, force-reload (there is also an optional reload method), and then the link can be generated by the update-rc.d (I directly used rcconf ......). An example is provided, indicating that mystar logon is handled by using the image.

/Etc/init. d/mystar content is as follows:

#! /Bin/sh
#
# A shell for start mystar to log on network

# Test-x/usr/local/bin/mystar | exit 0

Case "$1" in
Start)
Echo-n "Starting Log in network :"
Start-stop-daemon -- start -- exec/usr/local/bin/mystardaemon. sh \
-- Chdir/usr/local/bin/
Echo "."
;;
Stop)
Echo-n "Stop from log in network"
;;
Restart)
;;
Force-reload | reload)
;;
*)
Echo "Usage:/etc/init. d/mystar "\
"{Start}"> & 2
Exit 1
;;
Esac

Exit 0

Because it is started in the background and needs to be used, I wrote a mystardaemon. sh file under/usr/local/bin to start mystar:

/Usr/local/bin/mystardaemon. sh:
#! /Bin/sh

Cd/usr/local/bin
./Mystar &

It's easy. And ...... In fact, this does not comply with Debian standards. So far, I have no idea how to stop mystar ...... Kill cannot be dropped ...... I don't know how to fix it ...... So the script can only be started ...... The last step is simple. Execute rcconf and check mystar. If you have time to study whether you can write more standards. In addition, this mystar seems to be a little bit of a bit of time, to see if you can find the information to rewrite it as a trainer ......

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.