Bug 101767 - ports: www/resin3 does not start with "faststart"
Summary: ports: www/resin3 does not start with "faststart"
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Herve Quiroz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-10 18:50 UTC by John Nielsen
Modified: 2006-08-28 22:32 UTC (History)
1 user (show)

See Also:


Attachments
20060822-freebsd-resin3-faststart (561 bytes, text/plain; charset=utf-8)
2006-08-22 10:04 UTC, Jean-Baptiste Quenot
no flags Details
20060822-freebsd-resin3-faststart (526 bytes, text/plain; charset=utf-8)
2006-08-22 15:22 UTC, Jean-Baptiste Quenot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Nielsen 2006-08-10 18:50:13 UTC
	Resin currently fails to start at boot on rcng systems (such as FreeBSD 6.1)
	that pass the "faststart" argument to the rc scripts. Resin's rc script
	simply passes whatever argument it is given on to the resinctl utility,
	and without the patch below resinctl does not recognize "faststart" as
	a valid argument.

Fix: Apply this patch to ports/www/resin3/files/resinctl.



-------------------------------------------------------

--Boundary-00=_wC32EtmRpzYdMOc
Content-Type: text/plain;
  name="ports: www/resin3 does not start with "faststart""
Content-Transfer-Encoding: 7bit--5wioYJN1lMsq55Pl1ldD49IbSeHFD6NQkCwKyYYam635xmBY
Content-Type: text/plain; name="resinctl.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="resinctl.patch"

--- resinctl.orig	Thu Aug 10 13:30:39 2006
+++ resinctl	Thu Aug 10 13:31:56 2006
@@ -67,7 +67,7 @@
         return 0

 def usage():
-    print >> sys.stderr, "Usage: %s {start|stop|restart}" % sys.argv[0]
+    print >> sys.stderr, "Usage: %s {start|faststart|stop|restart}" %
 sys.argv[0]

 def start():
     cwd = os.getcwd()
@@ -174,6 +174,9 @@
         sys.exit(1)

     if sys.argv[-1] == "start":
+        start()
+
+    elif sys.argv[-1] == "faststart":
         start()

     elif sys.argv[-1] == "stop":
How-To-Repeat: 	Reboot a FreeBSD 6.1 system with resin installed. Resin fails to start, and
	(depending on its configuration) Apache may fail as well.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2006-08-10 18:50:20 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback
Comment 2 Jean-Baptiste Quenot 2006-08-11 08:50:24 UTC
I can't find the faststart argument in the rc man page:
http://www.freebsd.org/cgi/man.cgi?query=rc&sektion=8

Could you please provide a link to the relevant documentation?
-- 
     Jean-Baptiste Quenot
aka  John Banana Qwerty
http://caraldi.com/jbq/
Comment 3 Herve Quiroz freebsd_committer freebsd_triage 2006-08-12 23:38:25 UTC
Responsible Changed
From-To: freebsd-ports-bugs->hq

I'll handle this.
Comment 4 Boris Kovalenko 2006-08-22 09:21:22 UTC
Hello!

	John is right, Jean-Baptiste. I see this problem too. Please look "man 
rc.subr" for faststart:
          argument may have one of the following prefixes which alters its
            operation:

                  fast   Skip the check for an existing running process, and
                         sets rc_fast=YES.

                  force  Skip the checks for rcvar being set to ``YES'', and
                         sets rc_force=YES.  This ignores argument_precmd
                         returning non-zero, and ignores any of the 
required_*
                         tests failing, and always returns a zero exit 
status.

                  one    Skip the checks for rcvar being set to ``YES'', but
                         performs all the other prerequisite tests.


But I disagree the way Jhon implemented. IMHO resin3 rcNG script should 
be modified to remove "fast" prefix from argument.

With respect,
	Boris Kovalenko
Comment 5 Jean-Baptiste Quenot 2006-08-22 09:37:24 UTC
Thank you Boris,

I see now that all possible prefixes should be removed.
-- 
     Jean-Baptiste Quenot
aka  John Banana Qwerty
http://caraldi.com/jbq/
Comment 6 Jean-Baptiste Quenot 2006-08-22 10:04:25 UTC
What about the attached patch?
-- 
     Jean-Baptiste Quenot
aka  John Banana Qwerty
http://caraldi.com/jbq/
Comment 7 Jean-Baptiste Quenot 2006-08-22 15:22:03 UTC
What about this one?
-- 
     Jean-Baptiste Quenot
aka  John Banana Qwerty
http://caraldi.com/jbq/
Comment 8 Jean-Baptiste Quenot 2006-08-23 09:00:40 UTC
* Boris Kovalenko:

>    Are You sure I should try it? As I see it will not work for "stop" command :)

Yes, rc.subr is designed to run the command only for "start" by
default.  See description for the "stop" argument below, it does
not invoke "command":

           For a given method argument, if argument_cmd is not defined, then a
           default method is provided by run_rc_command:

                 Argument  Default method

                 start     If command is not running and checkyesno rcvar suc-
                           ceeds, start command.

                 stop      Determine the PIDs of command with check_pidfile or
                           check_process (as appropriate), kill sig_stop those
                           PIDs, and run wait_for_pids on those PIDs.
-- 
     Jean-Baptiste Quenot
aka  John Banana Qwerty
http://caraldi.com/jbq/
Comment 9 Jean-Baptiste Quenot 2006-08-28 11:24:49 UTC
Please use the latest patch in this thread marked with date
"Tue Aug 22 16:19:58 2006".  Thank you.
-- 
     Jean-Baptiste Quenot
aka  John Banana Qwerty
http://caraldi.com/jbq/
Comment 10 Herve Quiroz freebsd_committer freebsd_triage 2006-08-28 22:19:54 UTC
State Changed
From-To: feedback->open

Feedback received. New patch tested.
Comment 11 Herve Quiroz freebsd_committer freebsd_triage 2006-08-28 22:31:56 UTC
State Changed
From-To: open->closed

Patch commited. 

Thanks for your contribution!