Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 58577 - Wvdial init script
Summary: Wvdial init script
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Dialup Developers
URL:
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks:
 
Reported: 2004-07-27 12:04 UTC by Rouslan Solomakhin
Modified: 2004-11-07 03:40 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Timers to wait for wvdial. "need slmodem" is now optional. (wvdial.patch,2.12 KB, patch)
2004-07-31 23:01 UTC, Rouslan Solomakhin
Details | Diff
The patched wvdial init script (net.wvdial,1.64 KB, text/plain)
2004-07-31 23:04 UTC, Rouslan Solomakhin
Details
/etc/conf.d/net.wvdial - wvdial init script configuration (net.wvdial,154 bytes, text/plain)
2004-07-31 23:07 UTC, Rouslan Solomakhin
Details
The version of script marked "Stable" (net.wvdial,2.47 KB, text/plain)
2004-08-02 22:28 UTC, Rouslan Solomakhin
Details
Configuration for the "Stable" init script (net.wvdial,281 bytes, text/plain)
2004-08-02 22:29 UTC, Rouslan Solomakhin
Details
Some bug fixes and enhancements (wvdial.patch,2.00 KB, patch)
2004-08-04 01:53 UTC, Rouslan Solomakhin
Details | Diff
The patched script (net.wvdial,2.80 KB, text/plain)
2004-08-04 01:56 UTC, Rouslan Solomakhin
Details
Simplified calculation of STOP/START_STRING_LEN (wvdial.patch,647 bytes, patch)
2004-08-05 10:32 UTC, Rouslan Solomakhin
Details | Diff
Ignore this (slmodem,2.60 KB, text/plain)
2004-08-05 22:18 UTC, Rouslan Solomakhin
Details
Init script with the above patch (net.wvdial,2.72 KB, text/plain)
2004-08-05 22:21 UTC, Rouslan Solomakhin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rouslan Solomakhin 2004-07-27 12:04:07 UTC
net-dialup/wvdial does not contain an init script. Here is one that I wrote. Any suggestions would be welcome. It might be a good idea to include this with the package.
----------------------------------------------------------
#!/sbin/runscript
#
# $Id: net.wvdial,v 1.3 2004/07/27 18:35:08 rouslan Exp $
#
 
depend() {
    need slmodem
}
 
checkinstalled() {
        PATH=/bin:/usr/bin:/sbin:/usr/sbin which wvdial >/dev/null
        if [ $? != 0 ]
        then
                eerror "Please install wvdial."
                return 1
        fi
}
 
checkconfigured() {
        PATH=/bin:/usr/bin:/sbin:/usr/sbin find /etc/wvdial.conf >/dev/null
        if [ $? != 0 ]
        then
                eerror "Configaration file /etc/wvdial.conf is missing."
                eerror "Please run \"wvdialconf\" to configure wvdial."
                return 1
        fi
}
 
checkinterfaceup() {
        PATH=/bin:/usr/bin:/sbin:/usr/sbin ifconfig | grep ppp >/dev/null
        if [ $? == 0 ]
        then
                eerror "PPP interface is already up."
                return 1
        fi
}
 
checkall() {
        checkinstalled || return 1
        checkconfigured || return 1
        checkinterfaceup || return 1
}
 
checkstarted() {
        PATH=/bin:/usr/bin:/sbin:/usr/sbin ifconfig | grep ppp >/dev/null
        eend $?
}
 
start() {
        checkall || return 1
 
        ebegin "Starting wvdial"
 
        start-stop-daemon --start --quiet --background --exec /usr/bin/wvdial \
                -- "$OPTIONS"
        # Because of "background" option, we cannot get a return status of
        # wvdial. It usually starts in about 30 to 40 seconds.
        sleep 40
        checkstarted
}
 
stop() {
        ebegin "Stopping wvdial"
        start-stop-daemon --stop --quiet --exec /usr/bin/wvdial
        eend $?
        # It takes a few seconds for wvdial to disconnect.
        sleep 5
}
------------------------------------------------------------
Enjoy using it.


Reproducible: Always
Steps to Reproduce:
Comment 1 Rouslan Solomakhin 2004-07-27 12:14:46 UTC
BTW, "need slmodem" line is only required for net-dialup/slmodem ~x86 users.
Comment it out if you are not one.
Comment 2 Rouslan Solomakhin 2004-07-31 23:01:59 UTC
Created attachment 36561 [details, diff]
Timers to wait for wvdial. "need slmodem" is now optional.
Comment 3 Rouslan Solomakhin 2004-07-31 23:04:50 UTC
Created attachment 36562 [details]
The patched wvdial init script

This is the wvdial init script with the previous patch (Attachment 36561 [details, diff])
applied.
Comment 4 Rouslan Solomakhin 2004-07-31 23:07:59 UTC
Created attachment 36563 [details]
/etc/conf.d/net.wvdial - wvdial init script configuration

This is the configuration file for wvdial init script. It containts variables
${OPTIONS} and ${SLMODEM}. The first one is options to pass to wvdial (e.g.,
"phone2"). The second one is whether or not to be dependant on slmodem.
Comment 5 Rouslan Solomakhin 2004-08-02 22:28:24 UTC
Created attachment 36685 [details]
The version of script marked "Stable"

This init script now does what it is supposed to do  and does it nicely. Check
it out -- you will like it. :D
Comment 6 Rouslan Solomakhin 2004-08-02 22:29:38 UTC
Created attachment 36686 [details]
Configuration for the "Stable" init script
Comment 7 Rouslan Solomakhin 2004-08-04 01:53:52 UTC
Created attachment 36736 [details, diff]
Some bug fixes and enhancements

Added a check for wvdial quitting unexpectedly wheb there's no dial-tone.
Made the pid file configurable from the top of the init script.
Now, only trying to kill wvdial if it still runs.
Comment 8 Rouslan Solomakhin 2004-08-04 01:56:29 UTC
Created attachment 36737 [details]
The patched script

The init script with the previous patch (Attachment 36736 [details, diff]) applied.
Comment 9 Rouslan Solomakhin 2004-08-05 10:32:53 UTC
Created attachment 36828 [details, diff]
Simplified calculation of STOP/START_STRING_LEN
Comment 10 Rouslan Solomakhin 2004-08-05 22:18:33 UTC
Created attachment 36861 [details]
Ignore this
Comment 11 Rouslan Solomakhin 2004-08-05 22:20:15 UTC
Comment on attachment 36861 [details]
Ignore this

Ooops! wrong file :D
Comment 12 Rouslan Solomakhin 2004-08-05 22:21:10 UTC
Created attachment 36862 [details]
Init script with the above patch
Comment 13 Alin Năstac (RETIRED) gentoo-dev 2004-10-09 23:31:19 UTC
There is already a script (net.ppp) which launch a dial-up connection. Don't see why we should add another script for that, dependent by additional programs. 

wvdial's users want to use it as a dialer, not as a daemon.
Comment 14 Alin Năstac (RETIRED) gentoo-dev 2004-11-07 03:40:35 UTC
rejected for the reason exposed in comment #13