Modify

Opened 9 years ago

Closed 9 years ago

#3063 closed defect (fixed)

Parameters not propagated in /etc/rc.common restart

Reported by: argovela-at-yahoo-com Owned by: developers
Priority: normal Milestone: Kamikaze 7.09
Component: base system Version:
Keywords: init script rc.common restart Cc:

Description

When a parameter is supplied to the start/stop functions of an init script, it allows the script to refine its behavior accordingly. Since the restart function is merely a shorthand for a stop-then-start behavior, it can also be provided with parameters. Currently, however, the restart function does not pass its parameters to either of the subordinate stop/start functions.

In lines #20-21 below, the positional shell parameters supplied to the restart shell function should be propagated to both the stop and start functions.

From https://dev.openwrt.org/browser/trunk/package/base-files/files/etc/rc.common

18 	restart() {
19 	        trap '' TERM
20 	        stop
21 	        start
22 	}

The following changes would address this issue:

20 	        stop  "$@"
21 	        start "$@"

Attachments (0)

Change History (2)

comment:1 Changed 9 years ago by Luboš Staněk <lubek@…>

Thanks for reporting. It fixes my previous implementation.

I extended it also for the boot function as the optional parameter is provided to all functions in the eval block.

comment:2 Changed 9 years ago by nbd

  • Resolution set to fixed
  • Status changed from new to closed

fixed in r10245

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.