Opened 20 years ago

Closed 20 years ago

#2426 closed defect (fixed)

FEATURE ADDITION: create StartupItems via port(1)

Reported by: mww@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: base Version: 1.0
Keywords: Cc:
Port:

Description

This patch add new keywords to port(1):

startupitem

[yes|no], default=no should port create a StartupItem?

startupitem.name

string, default=${name} name of the StartupItem

startupitem.start

string, default="sh ${prefix}/etc/rc.d/${startupitem.name} start" howto start the daemon

startupitem.stop

... see startupitem.start

startupitem.restart

... see startupitem.start

patchfiles: http://www.opendarwin.org/~mww/patches/startupitem/patch-portmain.tcl.txt http://www.opendarwin.org/~mww/patches/startupitem/patch-portdestroot.tcl.txt

This may be a rather unelegant way, but all Tcl-cracks are invited to improve this hack...

Attachments (2)

patch-portdestroot.tcl (788 bytes) - added by mww@… 20 years ago.
patch for portdestroot.tcl
portstartupitem.tcl (4.0 KB) - added by mww@… 20 years ago.
base/src/port1.0/portstartupitem.tcl

Download all attachments as: .zip

Change History (12)

comment:1 Changed 20 years ago by mww@…

and...

startupitem.requires

string, default="Disks", "NFS" controlling startup sequence

comment:2 Changed 20 years ago by pguyot (Paul Guyot)

Umm.

  • Why would you like to replace DarwinStartupItems with individual items?
  • Wouldn't it be a darwin-only patch?
  • How many ports will benefit from this?

comment:3 Changed 20 years ago by mww@…

-we already have some darwin only stuff (e. g. build.type pbx); also we could implement other means of startupitem-creation for other systems (e. g. create $name.sh in /usr/local/etc/rc.d for freebsd, /etc/ init.d/ for *linux) -DarwinPortsStartup doesnt fit well into Darwin/MacOS-X style of startup items (seems more like a startup item inside another); if you use SystemStarter with DarwinPortsStartup, you only can start _all_ your daemons at one. -Some ports already bring their own StartupItem (e. g. smartmontools) -ports to benefit: apache, apache2, openntpd, smartmontools, clamsmtp, courier-imap, imap-uw, postfix, uptimec, anacron, fcron, syslog-ng, freeradius, yardradius, zope, jetty, silc-server, aolserver, postgresql, postgresql8, mysql, mysql4, openldap, tomcat5, jabberd, rsync, bind9, dhcp, dnsmasq, bnetd, fsp, moftpd, oftpd, proftpd, pureftpd, tftp-hpa, vsftpd, squid, throttled, tiny-proxy, vsftpd (to name some)

comment:4 Changed 20 years ago by danielluke (Daniel J. Luke)

I, for one, really like the idea of using 'regular' startup items instead of the DarwinPortsStartup script although as has been discussed in the past, this does involve installing things outside of ${prefix} unless/until we can get a patch to SystemStarter submitted to Apple to allow it to search other directories.

comment:5 Changed 20 years ago by mww@…

this patch will create the StartupItems in $prefix/etc/Startupitems/

-either port could automatically symlink them to /Library/StartupItems or -the user could (perhaps through a config tool) activate those StartupItems this way

Changed 20 years ago by mww@…

Attachment: patch-portdestroot.tcl added

patch for portdestroot.tcl

Changed 20 years ago by mww@…

Attachment: portstartupitem.tcl added

base/src/port1.0/portstartupitem.tcl

comment:6 Changed 20 years ago by mww@…

The two attached files [1710, 1711] should do the trick in a less intrusive way, avoiding an even more crowded portdestroot.tcl; also this now works on the darwin platform only - on other platforms no files will be generated; nevertheless there is a hook for startup-scripts creation for other OSs.

also now it is

startupitem.create [yes|no]

instead of just

startupitem [yes|no]

comment:7 Changed 20 years ago by waqar@…

I would like to recommend that we use ${prefix}/Library/StartupItems instead of ${prefix}/etc/ StartupItems.

comment:8 Changed 20 years ago by rshaw@…

I disagree. I don't want to have a "Library" directory at the root of our ${prefix}, that's just ugly. The logical place for these is ${prefix}/etc/StartupItems as Markus has setup since these are analogous to the ${prefix}/etc/rc.d scripts.

comment:9 Changed 20 years ago by michaelm@…

We will have Library in prefix for Darwin at least if we move over to putting Frameworks etc in prefix and linking them into /Library as proposed during the Python framework discussions.

cheers

Michael

comment:10 Changed 20 years ago by mww@…

Resolution: fixed
Status: newclosed

submitted;

Note: See TracTickets for help on using tickets.