Merge lp:amahi/amahi-ubuntu into lp:amahi

Proposed by Cale Cunningham
Status: Needs review
Proposed branch: lp:amahi/amahi-ubuntu
Merge into: lp:amahi
Diff against target: 3784 lines (+1686/-1331)
49 files modified
apps/amahitunes5/debian/README.Debian (+15/-0)
apps/amahitunes5/debian/changelog (+23/-0)
apps/amahitunes5/debian/compat (+1/-0)
apps/amahitunes5/debian/control (+12/-0)
apps/amahitunes5/debian/copyright (+35/-0)
apps/amahitunes5/debian/docs (+1/-0)
apps/amahitunes5/debian/install (+7/-0)
apps/amahitunes5/debian/postinst (+54/-0)
apps/amahitunes5/debian/prerm (+51/-0)
apps/amahitunes5/debian/rules (+13/-0)
platform/hdactl/COPYING (+0/-690)
platform/hdactl/ChangeLog (+0/-15)
platform/hdactl/Makefile (+7/-5)
platform/hdactl/amahi-installer.debian (+125/-0)
platform/hdactl/amahi-installer.metainit (+7/-0)
platform/hdactl/debian/amahi-installer.init (+117/-0)
platform/hdactl/debian/changelog (+38/-1)
platform/hdactl/debian/control (+2/-3)
platform/hdactl/debian/copyright (+1/-1)
platform/hdactl/debian/dirs (+14/-0)
platform/hdactl/debian/hdactl.amahi-installer.init (+0/-155)
platform/hdactl/debian/hdactl.dirs (+0/-17)
platform/hdactl/debian/hdactl.hdactl.init (+0/-154)
platform/hdactl/debian/hdactl.init (+117/-0)
platform/hdactl/debian/hdactl.install (+0/-29)
platform/hdactl/debian/hdactl.postinst (+0/-46)
platform/hdactl/debian/install (+29/-0)
platform/hdactl/debian/postinst (+51/-0)
platform/hdactl/debian/preinst (+10/-0)
platform/hdactl/debian/rules (+8/-6)
platform/hdactl/hda-new-install (+403/-16)
platform/hdactl/hdactl.debian (+169/-105)
platform/hdactl/hdactl.metainit (+7/-0)
platform/platform/Makefile (+2/-7)
platform/platform/debian/changelog (+49/-0)
platform/platform/debian/control (+2/-2)
platform/platform/debian/dirs (+14/-0)
platform/platform/debian/hda-platform.dirs (+0/-14)
platform/platform/debian/hda-platform.install (+0/-18)
platform/platform/debian/hda-platform.postinst (+0/-44)
platform/platform/debian/install (+19/-0)
platform/platform/debian/postinst (+46/-0)
platform/platform/debian/rules (+3/-0)
platform/platform/hda-create-server.debian (+163/-0)
platform/platform/hda-update-webapps.debian (+33/-0)
platform/platform/html/app/models/user.rb (+3/-1)
platform/platform/html/db/migrate/20090711072328_add_shares_debug.rb (+1/-1)
platform/platform/html/lib/os-detect.rb (+31/-0)
platform/platform/html/script/install-app (+3/-1)
To merge this branch: bzr merge lp:amahi/amahi-ubuntu
Reviewer Review Type Date Requested Status
cpg lookover Pending
Review via email: mp+26896@code.launchpad.net

Description of the change

Introduces elementary support for Ubuntu

To post a comment you must log in.
lp:amahi/amahi-ubuntu updated
679. By Cale Cunningham

More merges.

680. By Cale Cunningham

Merged all latest git updates.

681. By Cale Cunningham

Typo fixes

682. By Cale Cunningham

Lotsa merge fixes. Includes new OS detection routine and library.

683. By Cale Cunningham

Removed merge junk from hdactl file.

Unmerged revisions

683. By Cale Cunningham

Removed merge junk from hdactl file.

682. By Cale Cunningham

Lotsa merge fixes. Includes new OS detection routine and library.

681. By Cale Cunningham

Typo fixes

680. By Cale Cunningham

Merged all latest git updates.

679. By Cale Cunningham

More merges.

678. By Cale Cunningham

More merges: added WOL (cpg)

677. By Cale Cunningham

More Debian Packaging Fixes

676. By Cale Cunningham

Merged most recent upstream commit.

675. By Cale Cunningham

Missing amahi-installer.debian file. Oops.

674. By Cale Cunningham

Massive merge changes!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'apps/amahitunes5/debian'
2=== added file 'apps/amahitunes5/debian/README.Debian'
3--- apps/amahitunes5/debian/README.Debian 1970-01-01 00:00:00 +0000
4+++ apps/amahitunes5/debian/README.Debian 2010-08-08 06:35:52 +0000
5@@ -0,0 +1,15 @@
6+amahitunes for Debian
7+---------------------
8+
9+This is a new version of AmahiTunes without a native Amahi app,
10+and instead with a separate webapp of it's own, created by
11+Guillaume Boudreau.
12+
13+As a bonus, it let's you stream to iTunes directly from the web
14+browser and also download the song.
15+
16+To do:
17+
18+ - support full configuration of the Firefly media server
19+
20+ -- Cale Cunningham <fspilotcale@gmail.com> Sun, 06 Jun 2010 11:13:56 -0500
21
22=== added file 'apps/amahitunes5/debian/changelog'
23--- apps/amahitunes5/debian/changelog 1970-01-01 00:00:00 +0000
24+++ apps/amahitunes5/debian/changelog 2010-08-08 06:35:52 +0000
25@@ -0,0 +1,23 @@
26+amahitunes (5-1ubuntu3) lucid; urgency=low
27+
28+ * Another stupid mistake.
29+
30+ -- Cale Cunningham <fspilotcale@gmail.com> Sat, 12 Jun 2010 22:59:52 -0500
31+
32+amahitunes (5-1ubuntu2) lucid; urgency=low
33+
34+ * Forgot rsync
35+
36+ -- Cale Cunningham <fspilotcale@gmail.com> Sat, 12 Jun 2010 22:31:52 -0500
37+
38+amahitunes (5-1ubuntu1) lucid; urgency=low
39+
40+ * Debian packaging fixes. Again.
41+
42+ -- Cale Cunningham <fspilotcale@gmail.com> Wed, 09 Jun 2010 01:20:57 -0500
43+
44+amahitunes (5-1) unstable; urgency=low
45+
46+ * Initial release <nnnn is the bug number of your ITP>
47+
48+ -- Cale Cunningham <fspilotcale@gmail.com> Sun, 06 Jun 2010 11:13:56 -0500
49
50=== added file 'apps/amahitunes5/debian/compat'
51--- apps/amahitunes5/debian/compat 1970-01-01 00:00:00 +0000
52+++ apps/amahitunes5/debian/compat 2010-08-08 06:35:52 +0000
53@@ -0,0 +1,1 @@
54+7
55
56=== added file 'apps/amahitunes5/debian/control'
57--- apps/amahitunes5/debian/control 1970-01-01 00:00:00 +0000
58+++ apps/amahitunes5/debian/control 2010-08-08 06:35:52 +0000
59@@ -0,0 +1,12 @@
60+Source: amahitunes
61+Section: web
62+Priority: extra
63+Maintainer: Cale Cunningham <fspilotcale@gmail.com>
64+Build-Depends: debhelper,rsync
65+Standards-Version: 3.8.3
66+Homepage: http://www.amahi.org
67+
68+Package: amahitunes5
69+Architecture: all
70+Depends: hdactl,hda-platform,rsync,mt-daapd
71+Description: Amahitunes is an iTunes-capable music streaming server based on daapd.
72
73=== added file 'apps/amahitunes5/debian/copyright'
74--- apps/amahitunes5/debian/copyright 1970-01-01 00:00:00 +0000
75+++ apps/amahitunes5/debian/copyright 2010-08-08 06:35:52 +0000
76@@ -0,0 +1,35 @@
77+This work was packaged for Debian by:
78+
79+ Cale Cunningham <fspilotcale@gmail.com> on Sun, 06 Jun 2010 11:13:56 -0500
80+
81+It was downloaded from <url://example.com>
82+
83+Upstream Author(s):
84+
85+ <put author's name and email here>
86+ <likewise for another author>
87+
88+Copyright:
89+
90+ <Copyright (C) YYYY Name OfAuthor>
91+ <likewise for another author>
92+
93+License:
94+
95+ <Put the license of the package here indented by 4 spaces>
96+
97+The Debian packaging is:
98+
99+ Copyright (C) 2010 Cale Cunningham <fspilotcale@gmail.com>
100+
101+# Please chose a license for your packaging work. If the program you package
102+# uses a mainstream license, using the same license is the safest choice.
103+# Please avoid to pick license terms that are more restrictive than the
104+# packaged work, as it may make Debian's contributions unacceptable upstream.
105+# If you just want it to be GPL version 3, leave the following lines in.
106+
107+and is licensed under the GPL version 3,
108+see `/usr/share/common-licenses/GPL-3'.
109+
110+# Please also look if there are files or directories which have a
111+# different copyright/license attached and list them here.
112
113=== added file 'apps/amahitunes5/debian/docs'
114--- apps/amahitunes5/debian/docs 1970-01-01 00:00:00 +0000
115+++ apps/amahitunes5/debian/docs 2010-08-08 06:35:52 +0000
116@@ -0,0 +1,1 @@
117+README
118
119=== added file 'apps/amahitunes5/debian/install'
120--- apps/amahitunes5/debian/install 1970-01-01 00:00:00 +0000
121+++ apps/amahitunes5/debian/install 2010-08-08 06:35:52 +0000
122@@ -0,0 +1,7 @@
123+# NOTE (cale250, 2010-06-06): Install daapd.conf this way.
124+
125+app /var/hda/platform/apps/amahitunes/
126+music /var/hda/platform/apps/amahitunes/
127+mt-daapd.conf /var/hda/platform/apps/amahitunes/
128+
129+#Yup. Seriously. That's it.
130
131=== added file 'apps/amahitunes5/debian/postinst'
132--- apps/amahitunes5/debian/postinst 1970-01-01 00:00:00 +0000
133+++ apps/amahitunes5/debian/postinst 2010-08-08 06:35:52 +0000
134@@ -0,0 +1,54 @@
135+#!/bin/sh
136+# postinst script for amahitunes
137+#
138+# see: dh_installdeb(1)
139+
140+set -e
141+
142+# summary of how this script can be called:
143+# * <postinst> `configure' <most-recently-configured-version>
144+# * <old-postinst> `abort-upgrade' <new version>
145+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
146+# <new-version>
147+# * <postinst> `abort-remove'
148+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
149+# <failed-install-package> <version> `removing'
150+# <conflicting-package> <version>
151+# for details, see http://www.debian.org/doc/debian-policy/ or
152+# the debian-policy package
153+
154+
155+case "$1" in
156+ configure)
157+ chown www-data:users /var/hda/platform/apps/amahitunes/mt-daapd.conf
158+ chmod 664 /var/hda/platform/apps/amahitunes/mt-daapd.conf
159+ mv /etc/mt-daapd.conf /etc/mt-daapd.conf.debsave
160+ ln -s /var/hda/platform/apps/amahitunes/mt-daapd.conf /etc/mt-daapd.conf
161+ mkdir -p /var/hda/files/music
162+ /sbin/chkconfig mt-daapd on
163+ service mt-daapd stop &> /dev/null
164+ service mt-daapd start &> /dev/null
165+ service apache2 reload &> /dev/null
166+
167+ if [ -z $(ls /var/hda/files/music/) ] ; then
168+ rsync -a /var/hda/platform/apps/amahitunes/music/ /var/hda/files/music/
169+ chown -R 500:users /var/hda/files/music
170+ fi
171+
172+ ;;
173+
174+ abort-upgrade|abort-remove|abort-deconfigure)
175+ ;;
176+
177+ *)
178+ echo "postinst called with unknown argument \`$1'" >&2
179+ exit 1
180+ ;;
181+esac
182+
183+# dh_installdeb will replace this with shell code automatically
184+# generated by other debhelper scripts.
185+
186+#DEBHELPER#
187+
188+exit 0
189
190=== added file 'apps/amahitunes5/debian/prerm'
191--- apps/amahitunes5/debian/prerm 1970-01-01 00:00:00 +0000
192+++ apps/amahitunes5/debian/prerm 2010-08-08 06:35:52 +0000
193@@ -0,0 +1,51 @@
194+#!/bin/sh
195+# prerm script for amahitunes
196+#
197+# see: dh_installdeb(1)
198+
199+set -e
200+
201+# summary of how this script can be called:
202+# * <prerm> `remove'
203+# * <old-prerm> `upgrade' <new-version>
204+# * <new-prerm> `failed-upgrade' <old-version>
205+# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
206+# * <deconfigured's-prerm> `deconfigure' `in-favour'
207+# <package-being-installed> <version> `removing'
208+# <conflicting-package> <version>
209+# for details, see http://www.debian.org/doc/debian-policy/ or
210+# the debian-policy package
211+
212+
213+case "$1" in
214+ remove|upgrade|deconfigure)
215+ if [ "$1" = 0 ]; then
216+ # an uninstall
217+ /sbin/service mt-daapd stop &> /dev/null
218+ /sbin/chkconfig mt-daapd off
219+ /sbin/chkconfig --del mt-daapd
220+ /sbin/service apache2 restart &> /dev/null
221+ mv /etc/mt-daapd.conf.debsave /etc/mt-daapd.conf
222+ else
223+ # update
224+ ( /usr/bin/killall mt-daapd && rm -f /var/run/mt-daapd.pid ) &> /dev/null
225+ # rely on monit to restart it properly see http://bugs.amahi.org/issues/show/21
226+ /sbin/service apache2 restart &> /dev/null
227+ fi
228+ ;;
229+
230+ failed-upgrade)
231+ ;;
232+
233+ *)
234+ echo "prerm called with unknown argument \`$1'" >&2
235+ exit 1
236+ ;;
237+esac
238+
239+# dh_installdeb will replace this with shell code automatically
240+# generated by other debhelper scripts.
241+
242+#DEBHELPER#
243+
244+exit 0
245
246=== added file 'apps/amahitunes5/debian/rules'
247--- apps/amahitunes5/debian/rules 1970-01-01 00:00:00 +0000
248+++ apps/amahitunes5/debian/rules 2010-08-08 06:35:52 +0000
249@@ -0,0 +1,13 @@
250+#!/usr/bin/make -f
251+# -*- makefile -*-
252+# Sample debian/rules that uses debhelper.
253+# This file was originally written by Joey Hess and Craig Small.
254+# As a special exception, when this file is copied by dh-make into a
255+# dh-make output file, you may use that output file without restriction.
256+# This special exception was added by Craig Small in version 0.37 of dh-make.
257+
258+# Uncomment this to turn on verbose mode.
259+#export DH_VERBOSE=1
260+
261+%:
262+ dh $@
263
264=== removed file 'platform/hdactl/COPYING'
265--- platform/hdactl/COPYING 2010-04-22 00:19:57 +0000
266+++ platform/hdactl/COPYING 1970-01-01 00:00:00 +0000
267@@ -1,690 +0,0 @@
268-Amahi Home Server
269-
270-This program is Copyright (C) 2007-2010, Amahi
271-
272-This program is free software released under the terms of the GNU
273-AGPLv3 (and no other AGPL version), found below for your convenience.
274-
275-We further require that you leave the logos and URLs pointing to
276-the Amahi web site intact and in the same visible condition if
277-you redistribute this program.
278-
279-Contact the Amahi Team at the address listed in
280-http://www.amahi.org/ (under Contact Us) if you are interested in
281-licensing this program under other terms.
282-
283-It is important to note that this license applies to the Amahi
284-platform and closely tied plugins and themes released by the
285-Amahi team, not to the programs that run on top of or aided by
286-the Amahi platform. Conversely, Amahi makes no claims as to the
287-Linux platforms on top of which it runs. Contributions and any
288-brands used are owned by their respective parties.
289-
290-The Amahi Team wishes to thank all the components of open source
291-system without which the Amahi Home Server would not be possible.
292-
293-The Amahi Team
294-
295------------------------------------------------------------------------
296-
297- GNU AFFERO GENERAL PUBLIC LICENSE
298- Version 3, 19 November 2007
299-
300- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
301- Everyone is permitted to copy and distribute verbatim copies
302- of this license document, but changing it is not allowed.
303-
304- Preamble
305-
306- The GNU Affero General Public License is a free, copyleft license for
307-software and other kinds of works, specifically designed to ensure
308-cooperation with the community in the case of network server software.
309-
310- The licenses for most software and other practical works are designed
311-to take away your freedom to share and change the works. By contrast,
312-our General Public Licenses are intended to guarantee your freedom to
313-share and change all versions of a program--to make sure it remains free
314-software for all its users.
315-
316- When we speak of free software, we are referring to freedom, not
317-price. Our General Public Licenses are designed to make sure that you
318-have the freedom to distribute copies of free software (and charge for
319-them if you wish), that you receive source code or can get it if you
320-want it, that you can change the software or use pieces of it in new
321-free programs, and that you know you can do these things.
322-
323- Developers that use our General Public Licenses protect your rights
324-with two steps: (1) assert copyright on the software, and (2) offer
325-you this License which gives you legal permission to copy, distribute
326-and/or modify the software.
327-
328- A secondary benefit of defending all users' freedom is that
329-improvements made in alternate versions of the program, if they
330-receive widespread use, become available for other developers to
331-incorporate. Many developers of free software are heartened and
332-encouraged by the resulting cooperation. However, in the case of
333-software used on network servers, this result may fail to come about.
334-The GNU General Public License permits making a modified version and
335-letting the public access it on a server without ever releasing its
336-source code to the public.
337-
338- The GNU Affero General Public License is designed specifically to
339-ensure that, in such cases, the modified source code becomes available
340-to the community. It requires the operator of a network server to
341-provide the source code of the modified version running there to the
342-users of that server. Therefore, public use of a modified version, on
343-a publicly accessible server, gives the public access to the source
344-code of the modified version.
345-
346- An older license, called the Affero General Public License and
347-published by Affero, was designed to accomplish similar goals. This is
348-a different license, not a version of the Affero GPL, but Affero has
349-released a new version of the Affero GPL which permits relicensing under
350-this license.
351-
352- The precise terms and conditions for copying, distribution and
353-modification follow.
354-
355- TERMS AND CONDITIONS
356-
357- 0. Definitions.
358-
359- "This License" refers to version 3 of the GNU Affero General Public License.
360-
361- "Copyright" also means copyright-like laws that apply to other kinds of
362-works, such as semiconductor masks.
363-
364- "The Program" refers to any copyrightable work licensed under this
365-License. Each licensee is addressed as "you". "Licensees" and
366-"recipients" may be individuals or organizations.
367-
368- To "modify" a work means to copy from or adapt all or part of the work
369-in a fashion requiring copyright permission, other than the making of an
370-exact copy. The resulting work is called a "modified version" of the
371-earlier work or a work "based on" the earlier work.
372-
373- A "covered work" means either the unmodified Program or a work based
374-on the Program.
375-
376- To "propagate" a work means to do anything with it that, without
377-permission, would make you directly or secondarily liable for
378-infringement under applicable copyright law, except executing it on a
379-computer or modifying a private copy. Propagation includes copying,
380-distribution (with or without modification), making available to the
381-public, and in some countries other activities as well.
382-
383- To "convey" a work means any kind of propagation that enables other
384-parties to make or receive copies. Mere interaction with a user through
385-a computer network, with no transfer of a copy, is not conveying.
386-
387- An interactive user interface displays "Appropriate Legal Notices"
388-to the extent that it includes a convenient and prominently visible
389-feature that (1) displays an appropriate copyright notice, and (2)
390-tells the user that there is no warranty for the work (except to the
391-extent that warranties are provided), that licensees may convey the
392-work under this License, and how to view a copy of this License. If
393-the interface presents a list of user commands or options, such as a
394-menu, a prominent item in the list meets this criterion.
395-
396- 1. Source Code.
397-
398- The "source code" for a work means the preferred form of the work
399-for making modifications to it. "Object code" means any non-source
400-form of a work.
401-
402- A "Standard Interface" means an interface that either is an official
403-standard defined by a recognized standards body, or, in the case of
404-interfaces specified for a particular programming language, one that
405-is widely used among developers working in that language.
406-
407- The "System Libraries" of an executable work include anything, other
408-than the work as a whole, that (a) is included in the normal form of
409-packaging a Major Component, but which is not part of that Major
410-Component, and (b) serves only to enable use of the work with that
411-Major Component, or to implement a Standard Interface for which an
412-implementation is available to the public in source code form. A
413-"Major Component", in this context, means a major essential component
414-(kernel, window system, and so on) of the specific operating system
415-(if any) on which the executable work runs, or a compiler used to
416-produce the work, or an object code interpreter used to run it.
417-
418- The "Corresponding Source" for a work in object code form means all
419-the source code needed to generate, install, and (for an executable
420-work) run the object code and to modify the work, including scripts to
421-control those activities. However, it does not include the work's
422-System Libraries, or general-purpose tools or generally available free
423-programs which are used unmodified in performing those activities but
424-which are not part of the work. For example, Corresponding Source
425-includes interface definition files associated with source files for
426-the work, and the source code for shared libraries and dynamically
427-linked subprograms that the work is specifically designed to require,
428-such as by intimate data communication or control flow between those
429-subprograms and other parts of the work.
430-
431- The Corresponding Source need not include anything that users
432-can regenerate automatically from other parts of the Corresponding
433-Source.
434-
435- The Corresponding Source for a work in source code form is that
436-same work.
437-
438- 2. Basic Permissions.
439-
440- All rights granted under this License are granted for the term of
441-copyright on the Program, and are irrevocable provided the stated
442-conditions are met. This License explicitly affirms your unlimited
443-permission to run the unmodified Program. The output from running a
444-covered work is covered by this License only if the output, given its
445-content, constitutes a covered work. This License acknowledges your
446-rights of fair use or other equivalent, as provided by copyright law.
447-
448- You may make, run and propagate covered works that you do not
449-convey, without conditions so long as your license otherwise remains
450-in force. You may convey covered works to others for the sole purpose
451-of having them make modifications exclusively for you, or provide you
452-with facilities for running those works, provided that you comply with
453-the terms of this License in conveying all material for which you do
454-not control copyright. Those thus making or running the covered works
455-for you must do so exclusively on your behalf, under your direction
456-and control, on terms that prohibit them from making any copies of
457-your copyrighted material outside their relationship with you.
458-
459- Conveying under any other circumstances is permitted solely under
460-the conditions stated below. Sublicensing is not allowed; section 10
461-makes it unnecessary.
462-
463- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
464-
465- No covered work shall be deemed part of an effective technological
466-measure under any applicable law fulfilling obligations under article
467-11 of the WIPO copyright treaty adopted on 20 December 1996, or
468-similar laws prohibiting or restricting circumvention of such
469-measures.
470-
471- When you convey a covered work, you waive any legal power to forbid
472-circumvention of technological measures to the extent such circumvention
473-is effected by exercising rights under this License with respect to
474-the covered work, and you disclaim any intention to limit operation or
475-modification of the work as a means of enforcing, against the work's
476-users, your or third parties' legal rights to forbid circumvention of
477-technological measures.
478-
479- 4. Conveying Verbatim Copies.
480-
481- You may convey verbatim copies of the Program's source code as you
482-receive it, in any medium, provided that you conspicuously and
483-appropriately publish on each copy an appropriate copyright notice;
484-keep intact all notices stating that this License and any
485-non-permissive terms added in accord with section 7 apply to the code;
486-keep intact all notices of the absence of any warranty; and give all
487-recipients a copy of this License along with the Program.
488-
489- You may charge any price or no price for each copy that you convey,
490-and you may offer support or warranty protection for a fee.
491-
492- 5. Conveying Modified Source Versions.
493-
494- You may convey a work based on the Program, or the modifications to
495-produce it from the Program, in the form of source code under the
496-terms of section 4, provided that you also meet all of these conditions:
497-
498- a) The work must carry prominent notices stating that you modified
499- it, and giving a relevant date.
500-
501- b) The work must carry prominent notices stating that it is
502- released under this License and any conditions added under section
503- 7. This requirement modifies the requirement in section 4 to
504- "keep intact all notices".
505-
506- c) You must license the entire work, as a whole, under this
507- License to anyone who comes into possession of a copy. This
508- License will therefore apply, along with any applicable section 7
509- additional terms, to the whole of the work, and all its parts,
510- regardless of how they are packaged. This License gives no
511- permission to license the work in any other way, but it does not
512- invalidate such permission if you have separately received it.
513-
514- d) If the work has interactive user interfaces, each must display
515- Appropriate Legal Notices; however, if the Program has interactive
516- interfaces that do not display Appropriate Legal Notices, your
517- work need not make them do so.
518-
519- A compilation of a covered work with other separate and independent
520-works, which are not by their nature extensions of the covered work,
521-and which are not combined with it such as to form a larger program,
522-in or on a volume of a storage or distribution medium, is called an
523-"aggregate" if the compilation and its resulting copyright are not
524-used to limit the access or legal rights of the compilation's users
525-beyond what the individual works permit. Inclusion of a covered work
526-in an aggregate does not cause this License to apply to the other
527-parts of the aggregate.
528-
529- 6. Conveying Non-Source Forms.
530-
531- You may convey a covered work in object code form under the terms
532-of sections 4 and 5, provided that you also convey the
533-machine-readable Corresponding Source under the terms of this License,
534-in one of these ways:
535-
536- a) Convey the object code in, or embodied in, a physical product
537- (including a physical distribution medium), accompanied by the
538- Corresponding Source fixed on a durable physical medium
539- customarily used for software interchange.
540-
541- b) Convey the object code in, or embodied in, a physical product
542- (including a physical distribution medium), accompanied by a
543- written offer, valid for at least three years and valid for as
544- long as you offer spare parts or customer support for that product
545- model, to give anyone who possesses the object code either (1) a
546- copy of the Corresponding Source for all the software in the
547- product that is covered by this License, on a durable physical
548- medium customarily used for software interchange, for a price no
549- more than your reasonable cost of physically performing this
550- conveying of source, or (2) access to copy the
551- Corresponding Source from a network server at no charge.
552-
553- c) Convey individual copies of the object code with a copy of the
554- written offer to provide the Corresponding Source. This
555- alternative is allowed only occasionally and noncommercially, and
556- only if you received the object code with such an offer, in accord
557- with subsection 6b.
558-
559- d) Convey the object code by offering access from a designated
560- place (gratis or for a charge), and offer equivalent access to the
561- Corresponding Source in the same way through the same place at no
562- further charge. You need not require recipients to copy the
563- Corresponding Source along with the object code. If the place to
564- copy the object code is a network server, the Corresponding Source
565- may be on a different server (operated by you or a third party)
566- that supports equivalent copying facilities, provided you maintain
567- clear directions next to the object code saying where to find the
568- Corresponding Source. Regardless of what server hosts the
569- Corresponding Source, you remain obligated to ensure that it is
570- available for as long as needed to satisfy these requirements.
571-
572- e) Convey the object code using peer-to-peer transmission, provided
573- you inform other peers where the object code and Corresponding
574- Source of the work are being offered to the general public at no
575- charge under subsection 6d.
576-
577- A separable portion of the object code, whose source code is excluded
578-from the Corresponding Source as a System Library, need not be
579-included in conveying the object code work.
580-
581- A "User Product" is either (1) a "consumer product", which means any
582-tangible personal property which is normally used for personal, family,
583-or household purposes, or (2) anything designed or sold for incorporation
584-into a dwelling. In determining whether a product is a consumer product,
585-doubtful cases shall be resolved in favor of coverage. For a particular
586-product received by a particular user, "normally used" refers to a
587-typical or common use of that class of product, regardless of the status
588-of the particular user or of the way in which the particular user
589-actually uses, or expects or is expected to use, the product. A product
590-is a consumer product regardless of whether the product has substantial
591-commercial, industrial or non-consumer uses, unless such uses represent
592-the only significant mode of use of the product.
593-
594- "Installation Information" for a User Product means any methods,
595-procedures, authorization keys, or other information required to install
596-and execute modified versions of a covered work in that User Product from
597-a modified version of its Corresponding Source. The information must
598-suffice to ensure that the continued functioning of the modified object
599-code is in no case prevented or interfered with solely because
600-modification has been made.
601-
602- If you convey an object code work under this section in, or with, or
603-specifically for use in, a User Product, and the conveying occurs as
604-part of a transaction in which the right of possession and use of the
605-User Product is transferred to the recipient in perpetuity or for a
606-fixed term (regardless of how the transaction is characterized), the
607-Corresponding Source conveyed under this section must be accompanied
608-by the Installation Information. But this requirement does not apply
609-if neither you nor any third party retains the ability to install
610-modified object code on the User Product (for example, the work has
611-been installed in ROM).
612-
613- The requirement to provide Installation Information does not include a
614-requirement to continue to provide support service, warranty, or updates
615-for a work that has been modified or installed by the recipient, or for
616-the User Product in which it has been modified or installed. Access to a
617-network may be denied when the modification itself materially and
618-adversely affects the operation of the network or violates the rules and
619-protocols for communication across the network.
620-
621- Corresponding Source conveyed, and Installation Information provided,
622-in accord with this section must be in a format that is publicly
623-documented (and with an implementation available to the public in
624-source code form), and must require no special password or key for
625-unpacking, reading or copying.
626-
627- 7. Additional Terms.
628-
629- "Additional permissions" are terms that supplement the terms of this
630-License by making exceptions from one or more of its conditions.
631-Additional permissions that are applicable to the entire Program shall
632-be treated as though they were included in this License, to the extent
633-that they are valid under applicable law. If additional permissions
634-apply only to part of the Program, that part may be used separately
635-under those permissions, but the entire Program remains governed by
636-this License without regard to the additional permissions.
637-
638- When you convey a copy of a covered work, you may at your option
639-remove any additional permissions from that copy, or from any part of
640-it. (Additional permissions may be written to require their own
641-removal in certain cases when you modify the work.) You may place
642-additional permissions on material, added by you to a covered work,
643-for which you have or can give appropriate copyright permission.
644-
645- Notwithstanding any other provision of this License, for material you
646-add to a covered work, you may (if authorized by the copyright holders of
647-that material) supplement the terms of this License with terms:
648-
649- a) Disclaiming warranty or limiting liability differently from the
650- terms of sections 15 and 16 of this License; or
651-
652- b) Requiring preservation of specified reasonable legal notices or
653- author attributions in that material or in the Appropriate Legal
654- Notices displayed by works containing it; or
655-
656- c) Prohibiting misrepresentation of the origin of that material, or
657- requiring that modified versions of such material be marked in
658- reasonable ways as different from the original version; or
659-
660- d) Limiting the use for publicity purposes of names of licensors or
661- authors of the material; or
662-
663- e) Declining to grant rights under trademark law for use of some
664- trade names, trademarks, or service marks; or
665-
666- f) Requiring indemnification of licensors and authors of that
667- material by anyone who conveys the material (or modified versions of
668- it) with contractual assumptions of liability to the recipient, for
669- any liability that these contractual assumptions directly impose on
670- those licensors and authors.
671-
672- All other non-permissive additional terms are considered "further
673-restrictions" within the meaning of section 10. If the Program as you
674-received it, or any part of it, contains a notice stating that it is
675-governed by this License along with a term that is a further
676-restriction, you may remove that term. If a license document contains
677-a further restriction but permits relicensing or conveying under this
678-License, you may add to a covered work material governed by the terms
679-of that license document, provided that the further restriction does
680-not survive such relicensing or conveying.
681-
682- If you add terms to a covered work in accord with this section, you
683-must place, in the relevant source files, a statement of the
684-additional terms that apply to those files, or a notice indicating
685-where to find the applicable terms.
686-
687- Additional terms, permissive or non-permissive, may be stated in the
688-form of a separately written license, or stated as exceptions;
689-the above requirements apply either way.
690-
691- 8. Termination.
692-
693- You may not propagate or modify a covered work except as expressly
694-provided under this License. Any attempt otherwise to propagate or
695-modify it is void, and will automatically terminate your rights under
696-this License (including any patent licenses granted under the third
697-paragraph of section 11).
698-
699- However, if you cease all violation of this License, then your
700-license from a particular copyright holder is reinstated (a)
701-provisionally, unless and until the copyright holder explicitly and
702-finally terminates your license, and (b) permanently, if the copyright
703-holder fails to notify you of the violation by some reasonable means
704-prior to 60 days after the cessation.
705-
706- Moreover, your license from a particular copyright holder is
707-reinstated permanently if the copyright holder notifies you of the
708-violation by some reasonable means, this is the first time you have
709-received notice of violation of this License (for any work) from that
710-copyright holder, and you cure the violation prior to 30 days after
711-your receipt of the notice.
712-
713- Termination of your rights under this section does not terminate the
714-licenses of parties who have received copies or rights from you under
715-this License. If your rights have been terminated and not permanently
716-reinstated, you do not qualify to receive new licenses for the same
717-material under section 10.
718-
719- 9. Acceptance Not Required for Having Copies.
720-
721- You are not required to accept this License in order to receive or
722-run a copy of the Program. Ancillary propagation of a covered work
723-occurring solely as a consequence of using peer-to-peer transmission
724-to receive a copy likewise does not require acceptance. However,
725-nothing other than this License grants you permission to propagate or
726-modify any covered work. These actions infringe copyright if you do
727-not accept this License. Therefore, by modifying or propagating a
728-covered work, you indicate your acceptance of this License to do so.
729-
730- 10. Automatic Licensing of Downstream Recipients.
731-
732- Each time you convey a covered work, the recipient automatically
733-receives a license from the original licensors, to run, modify and
734-propagate that work, subject to this License. You are not responsible
735-for enforcing compliance by third parties with this License.
736-
737- An "entity transaction" is a transaction transferring control of an
738-organization, or substantially all assets of one, or subdividing an
739-organization, or merging organizations. If propagation of a covered
740-work results from an entity transaction, each party to that
741-transaction who receives a copy of the work also receives whatever
742-licenses to the work the party's predecessor in interest had or could
743-give under the previous paragraph, plus a right to possession of the
744-Corresponding Source of the work from the predecessor in interest, if
745-the predecessor has it or can get it with reasonable efforts.
746-
747- You may not impose any further restrictions on the exercise of the
748-rights granted or affirmed under this License. For example, you may
749-not impose a license fee, royalty, or other charge for exercise of
750-rights granted under this License, and you may not initiate litigation
751-(including a cross-claim or counterclaim in a lawsuit) alleging that
752-any patent claim is infringed by making, using, selling, offering for
753-sale, or importing the Program or any portion of it.
754-
755- 11. Patents.
756-
757- A "contributor" is a copyright holder who authorizes use under this
758-License of the Program or a work on which the Program is based. The
759-work thus licensed is called the contributor's "contributor version".
760-
761- A contributor's "essential patent claims" are all patent claims
762-owned or controlled by the contributor, whether already acquired or
763-hereafter acquired, that would be infringed by some manner, permitted
764-by this License, of making, using, or selling its contributor version,
765-but do not include claims that would be infringed only as a
766-consequence of further modification of the contributor version. For
767-purposes of this definition, "control" includes the right to grant
768-patent sublicenses in a manner consistent with the requirements of
769-this License.
770-
771- Each contributor grants you a non-exclusive, worldwide, royalty-free
772-patent license under the contributor's essential patent claims, to
773-make, use, sell, offer for sale, import and otherwise run, modify and
774-propagate the contents of its contributor version.
775-
776- In the following three paragraphs, a "patent license" is any express
777-agreement or commitment, however denominated, not to enforce a patent
778-(such as an express permission to practice a patent or covenant not to
779-sue for patent infringement). To "grant" such a patent license to a
780-party means to make such an agreement or commitment not to enforce a
781-patent against the party.
782-
783- If you convey a covered work, knowingly relying on a patent license,
784-and the Corresponding Source of the work is not available for anyone
785-to copy, free of charge and under the terms of this License, through a
786-publicly available network server or other readily accessible means,
787-then you must either (1) cause the Corresponding Source to be so
788-available, or (2) arrange to deprive yourself of the benefit of the
789-patent license for this particular work, or (3) arrange, in a manner
790-consistent with the requirements of this License, to extend the patent
791-license to downstream recipients. "Knowingly relying" means you have
792-actual knowledge that, but for the patent license, your conveying the
793-covered work in a country, or your recipient's use of the covered work
794-in a country, would infringe one or more identifiable patents in that
795-country that you have reason to believe are valid.
796-
797- If, pursuant to or in connection with a single transaction or
798-arrangement, you convey, or propagate by procuring conveyance of, a
799-covered work, and grant a patent license to some of the parties
800-receiving the covered work authorizing them to use, propagate, modify
801-or convey a specific copy of the covered work, then the patent license
802-you grant is automatically extended to all recipients of the covered
803-work and works based on it.
804-
805- A patent license is "discriminatory" if it does not include within
806-the scope of its coverage, prohibits the exercise of, or is
807-conditioned on the non-exercise of one or more of the rights that are
808-specifically granted under this License. You may not convey a covered
809-work if you are a party to an arrangement with a third party that is
810-in the business of distributing software, under which you make payment
811-to the third party based on the extent of your activity of conveying
812-the work, and under which the third party grants, to any of the
813-parties who would receive the covered work from you, a discriminatory
814-patent license (a) in connection with copies of the covered work
815-conveyed by you (or copies made from those copies), or (b) primarily
816-for and in connection with specific products or compilations that
817-contain the covered work, unless you entered into that arrangement,
818-or that patent license was granted, prior to 28 March 2007.
819-
820- Nothing in this License shall be construed as excluding or limiting
821-any implied license or other defenses to infringement that may
822-otherwise be available to you under applicable patent law.
823-
824- 12. No Surrender of Others' Freedom.
825-
826- If conditions are imposed on you (whether by court order, agreement or
827-otherwise) that contradict the conditions of this License, they do not
828-excuse you from the conditions of this License. If you cannot convey a
829-covered work so as to satisfy simultaneously your obligations under this
830-License and any other pertinent obligations, then as a consequence you may
831-not convey it at all. For example, if you agree to terms that obligate you
832-to collect a royalty for further conveying from those to whom you convey
833-the Program, the only way you could satisfy both those terms and this
834-License would be to refrain entirely from conveying the Program.
835-
836- 13. Remote Network Interaction; Use with the GNU General Public License.
837-
838- Notwithstanding any other provision of this License, if you modify the
839-Program, your modified version must prominently offer all users
840-interacting with it remotely through a computer network (if your version
841-supports such interaction) an opportunity to receive the Corresponding
842-Source of your version by providing access to the Corresponding Source
843-from a network server at no charge, through some standard or customary
844-means of facilitating copying of software. This Corresponding Source
845-shall include the Corresponding Source for any work covered by version 3
846-of the GNU General Public License that is incorporated pursuant to the
847-following paragraph.
848-
849- Notwithstanding any other provision of this License, you have
850-permission to link or combine any covered work with a work licensed
851-under version 3 of the GNU General Public License into a single
852-combined work, and to convey the resulting work. The terms of this
853-License will continue to apply to the part which is the covered work,
854-but the work with which it is combined will remain governed by version
855-3 of the GNU General Public License.
856-
857- 14. Revised Versions of this License.
858-
859- The Free Software Foundation may publish revised and/or new versions of
860-the GNU Affero General Public License from time to time. Such new versions
861-will be similar in spirit to the present version, but may differ in detail to
862-address new problems or concerns.
863-
864- Each version is given a distinguishing version number. If the
865-Program specifies that a certain numbered version of the GNU Affero General
866-Public License "or any later version" applies to it, you have the
867-option of following the terms and conditions either of that numbered
868-version or of any later version published by the Free Software
869-Foundation. If the Program does not specify a version number of the
870-GNU Affero General Public License, you may choose any version ever published
871-by the Free Software Foundation.
872-
873- If the Program specifies that a proxy can decide which future
874-versions of the GNU Affero General Public License can be used, that proxy's
875-public statement of acceptance of a version permanently authorizes you
876-to choose that version for the Program.
877-
878- Later license versions may give you additional or different
879-permissions. However, no additional obligations are imposed on any
880-author or copyright holder as a result of your choosing to follow a
881-later version.
882-
883- 15. Disclaimer of Warranty.
884-
885- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
886-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
887-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
888-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
889-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
890-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
891-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
892-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
893-
894- 16. Limitation of Liability.
895-
896- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
897-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
898-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
899-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
900-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
901-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
902-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
903-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
904-SUCH DAMAGES.
905-
906- 17. Interpretation of Sections 15 and 16.
907-
908- If the disclaimer of warranty and limitation of liability provided
909-above cannot be given local legal effect according to their terms,
910-reviewing courts shall apply local law that most closely approximates
911-an absolute waiver of all civil liability in connection with the
912-Program, unless a warranty or assumption of liability accompanies a
913-copy of the Program in return for a fee.
914-
915- END OF TERMS AND CONDITIONS
916-
917- How to Apply These Terms to Your New Programs
918-
919- If you develop a new program, and you want it to be of the greatest
920-possible use to the public, the best way to achieve this is to make it
921-free software which everyone can redistribute and change under these terms.
922-
923- To do so, attach the following notices to the program. It is safest
924-to attach them to the start of each source file to most effectively
925-state the exclusion of warranty; and each file should have at least
926-the "copyright" line and a pointer to where the full notice is found.
927-
928- <one line to give the program's name and a brief idea of what it does.>
929- Copyright (C) <year> <name of author>
930-
931- This program is free software: you can redistribute it and/or modify
932- it under the terms of the GNU Affero General Public License as published by
933- the Free Software Foundation, either version 3 of the License, or
934- (at your option) any later version.
935-
936- This program is distributed in the hope that it will be useful,
937- but WITHOUT ANY WARRANTY; without even the implied warranty of
938- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
939- GNU Affero General Public License for more details.
940-
941- You should have received a copy of the GNU Affero General Public License
942- along with this program. If not, see <http://www.gnu.org/licenses/>.
943-
944-Also add information on how to contact you by electronic and paper mail.
945-
946- If your software can interact with users remotely through a computer
947-network, you should also make sure that it provides a way for users to
948-get its source. For example, if your program is a web application, its
949-interface could display a "Source" link that leads users to an archive
950-of the code. There are many ways you could offer source, and different
951-solutions will be better for different programs; see section 13 for the
952-specific requirements.
953-
954- You should also get your employer (if you work as a programmer) or school,
955-if any, to sign a "copyright disclaimer" for the program, if necessary.
956-For more information on this, and how to apply and follow the GNU AGPL, see
957-<http://www.gnu.org/licenses/>.
958
959=== removed file 'platform/hdactl/ChangeLog'
960--- platform/hdactl/ChangeLog 2009-10-13 05:15:48 +0000
961+++ platform/hdactl/ChangeLog 1970-01-01 00:00:00 +0000
962@@ -1,15 +0,0 @@
963-Mon Oct 12 14:30:23 PDT 2009 Carlos Puchol <cpg@removethis.amahi.org>
964-
965- * updates to the new installer
966- * fixes to hdactl. closes #333 - default to enabled unless explicitly disabled
967-
968-Sun Oct 11 04:37:08 2009 -0700 Carlos Puchol <cpg+git@amahi.org>
969-
970- * fixes for f11 kickstart install on the new installer
971-
972-Wed Oct 7 19:43:33 2009 -0500 Michael Essary <essary@gmail.com>
973-
974- * Closes #18 - Modified hdactl to provide clients with a
975- secondary DNS. This patch uses the primary external DNS
976- setting in the database as the secondary DNS add ress.
977-
978
979=== modified file 'platform/hdactl/Makefile'
980--- platform/hdactl/Makefile 2010-07-31 17:17:55 +0000
981+++ platform/hdactl/Makefile 2010-08-08 06:35:52 +0000
982@@ -6,7 +6,7 @@
983
984 CFLAGS='-Wall'
985
986-all: rpm
987+
988
989 dist: hdactl-hup
990 (mkdir -p release && cd release && mkdir -p hdactl-$(VERSION))
991@@ -28,11 +28,13 @@
992 mv $(RPMBUILDDIR)/RPMS/$(ARCH)/hdactl-$(VERSION)-*.$(ARCH).rpm release/
993 mv $(RPMBUILDDIR)/SRPMS/hdactl-$(VERSION)-*.src.rpm release/
994
995-deb: update-header dist
996+deb: update-header
997 (cd release && ln -sf hdactl-$(VERSION).tar.gz hdactl_$(VERSION).orig.tar.gz)
998 (cd release && tar -zxf hdactl_$(VERSION).orig.tar.gz)
999-#Commenting out until can figure out why debuild -S is not working
1000- #(cd release/hdactl-$(VERSION)/debian && debuild -uc -us && debuild -S -uc -us)
1001- (cd release/hdactl-$(VERSION)/debian && debuild -uc -us)
1002+ #These have to be signed in order to be put into launchpad!
1003+ (debuild && debuild -S)
1004+
1005+donothing:
1006+
1007 install: rpm
1008 (cd release && sudo rpm -Uvh hdactl-$(VERSION)-*.$(ARCH).rpm)
1009
1010=== added file 'platform/hdactl/amahi-installer.debian'
1011--- platform/hdactl/amahi-installer.debian 1970-01-01 00:00:00 +0000
1012+++ platform/hdactl/amahi-installer.debian 2010-08-08 06:35:52 +0000
1013@@ -0,0 +1,125 @@
1014+#!/usr/bin/perl -w
1015+#
1016+# Amahi Home Server
1017+# Copyright (C) 2007-2009 Amahi Team
1018+#
1019+# This program is free software; you can redistribute it and/or
1020+# modify it under the terms of the GNU General Public License v3
1021+# (29 June 2007), as published in the COPYING file.
1022+#
1023+# This program is distributed in the hope that it will be useful,
1024+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1025+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1026+# file COPYING for more details.
1027+#
1028+# You should have received a copy of the GNU General Public
1029+# License along with this program; if not, write to the Amahi
1030+# team at http://www.amahi.org/ under "Contact Us."
1031+
1032+# web based installer front end
1033+
1034+use strict;
1035+use Getopt::Std;
1036+
1037+our($opt_f, $opt_h, $opt_q);
1038+getopts('fhq');
1039+
1040+my $LOG = "/tmp/amahi-ruby-install.log";
1041+
1042+sub fork_it {
1043+
1044+ my $pid = fork;
1045+ if ($pid < 0) {
1046+ print STDERR "ERROR: can not fork/detach ($!)\n";
1047+ exit -1;
1048+ } elsif ($pid) {
1049+ # parent simply exit
1050+ exit 0;
1051+ }
1052+ # chil continues execution
1053+ $SIG{'CHLD'} = 'DEFAULT';
1054+ open(STDOUT, ">$LOG");
1055+ open(STDERR, ">$LOG");
1056+ open(STDIN, "</dev/null");
1057+}
1058+
1059+
1060+sub do_system_multiple () {
1061+ my $args = shift;
1062+
1063+ # attempt the install at most this times
1064+ my $times = 10;
1065+ my $res = 0;
1066+ my $i = 0;
1067+
1068+ foreach (1..$times) {
1069+ last unless ($res = system ($args . " &> $LOG"));
1070+ }
1071+
1072+ return $res;
1073+}
1074+
1075+sub do_basic_checks {
1076+ $ENV{PATH} .= ":/sbin:/usr/sbin:/bin";
1077+ my $ruid = $<;
1078+ my $euid = $>;
1079+
1080+ if ($opt_h) {
1081+ printf "usage: amahi-installer [-f|-h]\n";
1082+ printf "\t -h - help\n";
1083+ printf "\t -f - force\n";
1084+ exit (1);
1085+ }
1086+ if ($euid != 0) {
1087+ printf "ERROR: this program must be run as \"root\". type \"su\" (to Switch User to root),\n";
1088+ printf " then input your root password, then run this program again.\n\n";
1089+ printf " \$ su\n";
1090+ printf " Password: (enter your root password)\n";
1091+ exit (1);
1092+ }
1093+ if (-e "/etc/amahi-hda") {
1094+ if ($opt_f) {
1095+ printf "WARNING: this system is already intialized for Amahi use\n";
1096+ } else {
1097+ # exit silently
1098+ printf ": this system is already intialized for Amahi use. (use -f to force at your own risk)\n" unless ($opt_q);
1099+ exit (0);
1100+ }
1101+ }
1102+}
1103+
1104+sub installed () {
1105+ my $pkg = shift;
1106+
1107+ return (system("dpkg -s $pkg &> /dev/null") == 0);
1108+}
1109+
1110+&do_basic_checks();
1111+
1112+printf "Starting the Amahi web-based installer (this may take a while) ...\n" unless ($opt_q);
1113+
1114+#have to install monit here
1115+#sets the apt-get installer to not go interactive if ncurses fires up
1116+&do_system_multiple("export DEBIAN_FRONTEND=noninteractive");
1117+&do_system_multiple("apt-get -y install monit");
1118+&do_system_multiple("apt-get -y install ruby");
1119+&do_system_multiple("apt-get -y install libmysql-ruby");
1120+&do_system_multiple("apt-get -y install libgemplugin-ruby");
1121+&do_system_multiple("apt-get -y install libopenssl-ruby");
1122+&do_system_multiple("gem install --no-ri --no-rdoc --version 0.9.4 sinatra");
1123+
1124+
1125+unless ($opt_q) {
1126+ # quiet mode
1127+ printf "Access it at this URL (Shift-Control-Click on the link):\n\n";
1128+ printf "\thttp://localhost:2000\n\n";
1129+ printf "For help:\n";
1130+ printf "\t- visit http://talk.amahi.org for live community help\n";
1131+ printf "\t- look for errors at the bottom of /root/hda-install.log\n";
1132+ printf "\t- paste any errors in http://paste.amahi.org/\n";
1133+ printf "\t- if you think it's a bug, file a bug in http://bugs.amahi.org/\n";
1134+}
1135+
1136+&fork_it;
1137+
1138+exec "ruby /usr/share/hdactl/web-installer/install-server &> $LOG";
1139
1140=== added file 'platform/hdactl/amahi-installer.metainit'
1141--- platform/hdactl/amahi-installer.metainit 1970-01-01 00:00:00 +0000
1142+++ platform/hdactl/amahi-installer.metainit 2010-08-08 06:35:52 +0000
1143@@ -0,0 +1,7 @@
1144+Short-Description: Amahi Install Controller
1145+Description: amahi-installer controls the installation of the Amahi platform.
1146+Exec: /usr/bin/amahi-installer
1147+Required-Start: $syslog $time $local_fs $remote_fs $network $named
1148+Required-Stop:
1149+Prestart-Hook: echo "Starting amahi-installer";
1150+Poststop-Hook: echo "Stopped amahi-installer";
1151
1152=== modified symlink 'platform/hdactl/debian/amahi-installer.init' (properties changed: -x to +x)
1153=== target was u'../amahi-installer.initscript'
1154--- platform/hdactl/debian/amahi-installer.init 1970-01-01 00:00:00 +0000
1155+++ platform/hdactl/debian/amahi-installer.init 2010-08-08 06:35:52 +0000
1156@@ -0,0 +1,117 @@
1157+#! /bin/sh
1158+#
1159+# This a generated file. DO NOT EDIT THIS FILE!
1160+# If you want to modify how this file works, please
1161+# modify /etc/metainit/amahi-installer.metainit and re-run update-metainit.
1162+#
1163+# If you are sure that you want to modify this file,
1164+# remove this comment, and update-metainit will not override
1165+# this script any more.
1166+#
1167+### BEGIN INIT INFO
1168+# Provides: amahi-installer
1169+# Default-Start:
1170+# Default-Stop: 1 2 3 4 5
1171+# Short-Description: Amahi Install Controller
1172+# Required-Start: $syslog $time $local_fs $remote_fs $network $named
1173+# Required-Stop:
1174+# Description: amahi-installer controls the installation of the Amahi platform.
1175+
1176+### END INIT INFO
1177+
1178+# PATH should only include /usr/* if it runs after the mountnfs.sh script
1179+PATH=/sbin:/usr/sbin:/bin:/usr/bin
1180+DESC=Amahi\ Install\ Controller
1181+NAME=amahi\-installer
1182+DAEMON=/usr/bin/amahi-installer
1183+BASENAME=amahi-installer
1184+DAEMON_ARGS=
1185+PIDFILE=/var/run/$NAME.pid
1186+SCRIPTNAME=/etc/init.d/$NAME
1187+# Exit if the package is not installed
1188+[ -x "$DAEMON" ] || exit 5
1189+
1190+# Load the VERBOSE setting and other rcS variables
1191+. /lib/init/vars.sh
1192+
1193+# Define LSB log_* functions.
1194+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
1195+. /lib/lsb/init-functions
1196+
1197+#
1198+# Function that starts the daemon/service
1199+#
1200+do_start()
1201+{
1202+ echo "Starting amahi-installer";
1203+ start-stop-daemon --start --oknodo --background --quiet --make-pidfile --pidfile $PIDFILE --exec $DAEMON -- \
1204+ $DAEMON_ARGS || return 1
1205+}
1206+
1207+#
1208+# Function that stops the daemon/service
1209+#
1210+do_stop()
1211+{
1212+ start-stop-daemon --stop --oknodo --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $BASENAME
1213+ RETVAL="$?"
1214+
1215+ rm -f $PIDFILE
1216+
1217+ return $RETVAL
1218+ echo "Stopped amahi-installer";
1219+ return "$RETVAL"
1220+}
1221+
1222+#
1223+# Function that sends a SIGHUP to the daemon/service
1224+#
1225+do_reload() {
1226+ start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
1227+ return 0
1228+}
1229+
1230+case "$1" in
1231+ start)
1232+ [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
1233+ do_start
1234+ log_end_msg $?
1235+ ;;
1236+ stop)
1237+ [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
1238+ do_stop
1239+ log_end_msg $?
1240+ ;;
1241+ #reload|force-reload)
1242+ #
1243+ # If do_reload() is not implemented then leave this commented out
1244+ # and leave 'force-reload' as an alias for 'restart'.
1245+ #
1246+ #log_daemon_msg "Reloading $DESC" "$NAME"
1247+ #do_reload
1248+ #log_end_msg $?
1249+ #;;
1250+ restart|force-reload)
1251+ #
1252+ # If the "reload" option is implemented then remove the
1253+ # 'force-reload' alias
1254+ #
1255+ log_daemon_msg "Restarting $DESC" "$NAME"
1256+ do_stop
1257+ case "$?" in
1258+ 0)
1259+ do_start
1260+ log_end_msg "$?"
1261+ ;;
1262+ *)
1263+ # Failed to stop
1264+ log_end_msg 1
1265+ ;;
1266+ esac
1267+ ;;
1268+ *)
1269+ #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
1270+ echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
1271+ exit 3
1272+ ;;
1273+esac
1274
1275=== modified file 'platform/hdactl/debian/changelog'
1276--- platform/hdactl/debian/changelog 2010-03-24 05:38:42 +0000
1277+++ platform/hdactl/debian/changelog 2010-08-08 06:35:52 +0000
1278@@ -1,3 +1,40 @@
1279+hdactl (3.2.2ubuntu6) lucid; urgency=low
1280+
1281+ * More merge fixes
1282+
1283+ -- Cale Cunningham <fspilotcale@gmail.com> Sun, 08 Aug 2010 01:25:13 -0500
1284+
1285+hdactl (3.2.2ubuntu5) lucid; urgency=low
1286+
1287+ * Fixed typos.
1288+
1289+ -- Cale Cunningham <fspilotcale@gmail.com> Sat, 07 Aug 2010 20:16:57 -0500
1290+
1291+hdactl (3.2.2ubuntu4) lucid; urgency=low
1292+
1293+ * Massive Merge Changes. Experimental.
1294+
1295+ -- Cale Cunningham <fspilotcale@gmail.com> Tue, 06 Jul 2010 02:27:20 -0500
1296+
1297+hdactl (3.2.2ubuntu3) lucid; urgency=low
1298+
1299+ * More renamed packages caused breakage.
1300+
1301+ -- Cale Cunningham <fspilotcale@gmail.com> Mon, 14 Jun 2010 20:02:03 -0500
1302+
1303+hdactl (3.2.2ubuntu2) lucid; urgency=low
1304+
1305+ * Changed from old racc1.8 to new racc package.
1306+
1307+ -- Cale Cunningham <fspilotcale@gmail.com> Sun, 13 Jun 2010 23:49:27 -0500
1308+
1309+hdactl (3.2.2ubuntu1) lucid; urgency=low
1310+
1311+ * Made a lot of changes and returned to original filetree.
1312+ * Debian Standard Format!
1313+
1314+ -- Cale Cunningham <fspilotcale@gmail.com> Tue, 01 Jun 2010 21:01:55 -0500
1315+
1316 hdactl (3.2.2) unstable; urgency=low
1317
1318 * Fixed init bug.
1319@@ -21,7 +58,7 @@
1320 * Updated makefile to run debuild with -us -uc command to disable package signing.
1321 * Updated control to reflect that Amahi Developers are the packager.
1322
1323- -- Kyle Law (Anzenketh) <tuxmaster@geekstogo.com> Fri, 19 Mar 2010 00:39:08 -0600
1324+ -- Kyle Law <tuxmaster@geekstogo.com> Fri, 19 Mar 2010 00:39:08 -0600
1325
1326 hdactl (2.40-1) unstable; urgency=low
1327
1328
1329=== modified file 'platform/hdactl/debian/control'
1330--- platform/hdactl/debian/control 2010-03-24 05:38:42 +0000
1331+++ platform/hdactl/debian/control 2010-08-08 06:35:52 +0000
1332@@ -2,14 +2,13 @@
1333 Section: web
1334 Priority: extra
1335 Maintainer: Amahi Developers <amahi-devel-request@lists.sourceforge.net>
1336-XSBC-Original-Maintainer: Amahi Developers <amahi-devel-request@lists.sourceforge.net>
1337 Build-Depends: debhelper (>= 7)
1338 Standards-Version: 3.8.0
1339 Homepage: http://www.amahi.org/
1340
1341 Package: hdactl
1342-Architecture: any
1343-Depends: chkconfig,bind9utils,openvpn,dhcp3-server,mysql-server,samba,apache2,monit,libauthen-pam-perl,ruby,libdbd-mysql-ruby,libroot-ruby-dev,eruby,libaugeas-ruby,irb,libdb-ruby1.8,libracc-runtime-ruby,rdoc,ri1.8,php5-mysql,php5,cadaver,liburi-perl,libwww-perl,rubygems
1344+Architecture: all
1345+Depends: chkconfig,bind9utils,openvpn,dhcp3-server,samba,apache2,monit,libauthen-pam-perl,ruby,libdbd-mysql-ruby,libroot-ruby-dev,eruby,libaugeas-ruby,irb,libdb-ruby1.8,libracc-runtime-ruby,rdoc,ri1.8,php5,cadaver,liburi-perl,libwww-perl,rubygems,build-essential
1346 Description: Amahi Home Digital Assistant daemon
1347 The Amahi Home Server is more than what you'd expect from a GNU/Linux
1348 home server. We call it "Home Digital Assistant" or HDA. The Amahi
1349
1350=== modified file 'platform/hdactl/debian/copyright'
1351--- platform/hdactl/debian/copyright 2010-03-20 03:39:16 +0000
1352+++ platform/hdactl/debian/copyright 2010-08-08 06:35:52 +0000
1353@@ -1,4 +1,4 @@
1354-Packaged by Carlos Puchol and Kyle Law from an original attempt
1355+Packaged by Carlos Puchol, Kyle Law and Cale Cunningham from an original attempt
1356 by Praveen Kumar.
1357
1358 Upstream Author(s):
1359
1360=== added file 'platform/hdactl/debian/dirs'
1361--- platform/hdactl/debian/dirs 1970-01-01 00:00:00 +0000
1362+++ platform/hdactl/debian/dirs 2010-08-08 06:35:52 +0000
1363@@ -0,0 +1,14 @@
1364+/etc/openvpn/amahi
1365+/var/hda
1366+/var/hda/calendar
1367+/var/hda/calendar/html
1368+/var/hda/calendar/locks
1369+/var/hda/calendar/logs
1370+/var/hda/files/books
1371+/var/hda/files/movies
1372+/var/hda/files/music
1373+/var/hda/files/pictures
1374+/var/hda/files/docs
1375+/var/hda/files/backups
1376+/var/hda/wiki
1377+/var/hda/wiki/logs
1378
1379=== added symlink 'platform/hdactl/debian/hda-update.cron.hourly'
1380=== target is u'../hda-update'
1381=== removed symlink 'platform/hdactl/debian/hda-update.hda-update.cron.hourly'
1382=== target was u'../hda-update'
1383=== removed file 'platform/hdactl/debian/hdactl.amahi-installer.init'
1384--- platform/hdactl/debian/hdactl.amahi-installer.init 2010-03-24 05:38:42 +0000
1385+++ platform/hdactl/debian/hdactl.amahi-installer.init 1970-01-01 00:00:00 +0000
1386@@ -1,155 +0,0 @@
1387-#! /bin/sh
1388-### BEGIN INIT INFO
1389-# Provides: amhi-installer
1390-# Required-Start: $remote_fs $syslog $networking
1391-# Required-Stop: $remote_fs $syslog
1392-# Default-Start: 2 3 4 5
1393-# Default-Stop: 0 1 6
1394-# Short-Description: Amahi Installer init script
1395-# Description: This starts the amahi-installer script based upon skeliton
1396-### END INIT INFO
1397-
1398-# Author: Amahi Team support@amahi.org
1399-#
1400-
1401-# Do NOT "set -e"
1402-
1403-# PATH should only include /usr/* if it runs after the mountnfs.sh script
1404-PATH=/sbin:/usr/sbin:/bin:/usr/bin
1405-DESC="Starts the amahi-installer"
1406-NAME=amahi-installer
1407-DAEMON=/usr/sbin/$NAME
1408-DAEMON_ARGS="--options args"
1409-PIDFILE=/var/run/$NAME.pid
1410-SCRIPTNAME=/etc/init.d/$NAME
1411-
1412-# Exit if the package is not installed
1413-[ -x "$DAEMON" ] || exit 0
1414-
1415-# Read configuration variable file if it is present
1416-[ -r /etc/default/$NAME ] && . /etc/default/$NAME
1417-
1418-# Load the VERBOSE setting and other rcS variables
1419-. /lib/init/vars.sh
1420-
1421-# Define LSB log_* functions.
1422-# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
1423-. /lib/lsb/init-functions
1424-
1425-#
1426-# Function that starts the daemon/service
1427-#
1428-do_start()
1429-{
1430- # Return
1431- # 0 if daemon has been started
1432- # 1 if daemon was already running
1433- # 2 if daemon could not be started
1434- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
1435- || return 1
1436- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
1437- $DAEMON_ARGS \
1438- || return 2
1439- # Add code here, if necessary, that waits for the process to be ready
1440- # to handle requests from services started subsequently which depend
1441- # on this one. As a last resort, sleep for some time.
1442-}
1443-
1444-#
1445-# Function that stops the daemon/service
1446-#
1447-do_stop()
1448-{
1449- # Return
1450- # 0 if daemon has been stopped
1451- # 1 if daemon was already stopped
1452- # 2 if daemon could not be stopped
1453- # other if a failure occurred
1454- start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
1455- RETVAL="$?"
1456- [ "$RETVAL" = 2 ] && return 2
1457- # Wait for children to finish too if this is a daemon that forks
1458- # and if the daemon is only ever run from this initscript.
1459- # If the above conditions are not satisfied then add some other code
1460- # that waits for the process to drop all resources that could be
1461- # needed by services started subsequently. A last resort is to
1462- # sleep for some time.
1463- start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
1464- [ "$?" = 2 ] && return 2
1465- # Many daemons don't delete their pidfiles when they exit.
1466- rm -f $PIDFILE
1467- return "$RETVAL"
1468-}
1469-
1470-#
1471-# Function that sends a SIGHUP to the daemon/service
1472-#
1473-do_reload() {
1474- #
1475- # If the daemon can reload its configuration without
1476- # restarting (for example, when it is sent a SIGHUP),
1477- # then implement that here.
1478- #
1479- start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
1480- return 0
1481-}
1482-
1483-case "$1" in
1484- start)
1485- [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
1486- do_start
1487- case "$?" in
1488- 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
1489- 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
1490- esac
1491- ;;
1492- stop)
1493- [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
1494- do_stop
1495- case "$?" in
1496- 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
1497- 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
1498- esac
1499- ;;
1500- status)
1501- status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
1502- ;;
1503- #reload|force-reload)
1504- #
1505- # If do_reload() is not implemented then leave this commented out
1506- # and leave 'force-reload' as an alias for 'restart'.
1507- #
1508- #log_daemon_msg "Reloading $DESC" "$NAME"
1509- #do_reload
1510- #log_end_msg $?
1511- #;;
1512- restart|force-reload)
1513- #
1514- # If the "reload" option is implemented then remove the
1515- # 'force-reload' alias
1516- #
1517- log_daemon_msg "Restarting $DESC" "$NAME"
1518- do_stop
1519- case "$?" in
1520- 0|1)
1521- do_start
1522- case "$?" in
1523- 0) log_end_msg 0 ;;
1524- 1) log_end_msg 1 ;; # Old process is still running
1525- *) log_end_msg 1 ;; # Failed to start
1526- esac
1527- ;;
1528- *)
1529- # Failed to stop
1530- log_end_msg 1
1531- ;;
1532- esac
1533- ;;
1534- *)
1535- #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
1536- echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
1537- exit 3
1538- ;;
1539-esac
1540-
1541-:
1542
1543=== removed file 'platform/hdactl/debian/hdactl.dirs'
1544--- platform/hdactl/debian/hdactl.dirs 2010-03-20 13:12:40 +0000
1545+++ platform/hdactl/debian/hdactl.dirs 1970-01-01 00:00:00 +0000
1546@@ -1,17 +0,0 @@
1547-/etc/openvpn/amahi
1548-
1549-/var/hda/calendar
1550-/var/hda/calendar/html
1551-/var/hda/calendar/locks
1552-/var/hda/calendar/logs
1553-
1554-/var/hda/files/books
1555-/var/hda/files/movies
1556-/var/hda/files/music
1557-/var/hda/files/pictures
1558-/var/hda/files/docs
1559-/var/hda/files/backups
1560-
1561-
1562-/var/hda/wiki
1563-/var/hda/wiki/logs
1564
1565=== removed file 'platform/hdactl/debian/hdactl.hdactl.init'
1566--- platform/hdactl/debian/hdactl.hdactl.init 2010-03-24 05:38:42 +0000
1567+++ platform/hdactl/debian/hdactl.hdactl.init 1970-01-01 00:00:00 +0000
1568@@ -1,154 +0,0 @@
1569-#! /bin/sh
1570-### BEGIN INIT INFO
1571-# Provides: $hdactl
1572-# Required-Start: $remote_fs $syslog $networking
1573-# Required-Stop: $remote_fs $syslog
1574-# Default-Start: 2 3 4 5
1575-# Default-Stop: 0 1 6
1576-# Short-Description: Example initscript
1577-# Description: This file should be used to construct scripts to be
1578-# placed in /etc/init.d.
1579-### END INIT INFO
1580-
1581-# Author: Amahi Debian Packaging team
1582-# Do NOT "set -e"
1583-
1584-# PATH should only include /usr/* if it runs after the mountnfs.sh script
1585-PATH=/sbin:/usr/sbin:/bin:/usr/bin
1586-DESC="Starts the HDACTL Deamon"
1587-NAME=hdactl
1588-DAEMON=/usr/sbin/$NAME
1589-DAEMON_ARGS="--options args"
1590-PIDFILE=/var/run/$NAME.pid
1591-SCRIPTNAME=/etc/init.d/$NAME
1592-
1593-# Exit if the package is not installed
1594-[ -x "$DAEMON" ] || exit 0
1595-
1596-# Read configuration variable file if it is present
1597-[ -r /etc/default/$NAME ] && . /etc/default/$NAME
1598-
1599-# Load the VERBOSE setting and other rcS variables
1600-. /lib/init/vars.sh
1601-
1602-# Define LSB log_* functions.
1603-# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
1604-. /lib/lsb/init-functions
1605-
1606-#
1607-# Function that starts the daemon/service
1608-#
1609-do_start()
1610-{
1611- # Return
1612- # 0 if daemon has been started
1613- # 1 if daemon was already running
1614- # 2 if daemon could not be started
1615- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
1616- || return 1
1617- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
1618- $DAEMON_ARGS \
1619- || return 2
1620- # Add code here, if necessary, that waits for the process to be ready
1621- # to handle requests from services started subsequently which depend
1622- # on this one. As a last resort, sleep for some time.
1623-}
1624-
1625-#
1626-# Function that stops the daemon/service
1627-#
1628-do_stop()
1629-{
1630- # Return
1631- # 0 if daemon has been stopped
1632- # 1 if daemon was already stopped
1633- # 2 if daemon could not be stopped
1634- # other if a failure occurred
1635- start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
1636- RETVAL="$?"
1637- [ "$RETVAL" = 2 ] && return 2
1638- # Wait for children to finish too if this is a daemon that forks
1639- # and if the daemon is only ever run from this initscript.
1640- # If the above conditions are not satisfied then add some other code
1641- # that waits for the process to drop all resources that could be
1642- # needed by services started subsequently. A last resort is to
1643- # sleep for some time.
1644- start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
1645- [ "$?" = 2 ] && return 2
1646- # Many daemons don't delete their pidfiles when they exit.
1647- rm -f $PIDFILE
1648- return "$RETVAL"
1649-}
1650-
1651-#
1652-# Function that sends a SIGHUP to the daemon/service
1653-#
1654-do_reload() {
1655- #
1656- # If the daemon can reload its configuration without
1657- # restarting (for example, when it is sent a SIGHUP),
1658- # then implement that here.
1659- #
1660- start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
1661- return 0
1662-}
1663-
1664-case "$1" in
1665- start)
1666- [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
1667- do_start
1668- case "$?" in
1669- 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
1670- 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
1671- esac
1672- ;;
1673- stop)
1674- [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
1675- do_stop
1676- case "$?" in
1677- 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
1678- 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
1679- esac
1680- ;;
1681- status)
1682- status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
1683- ;;
1684- #reload|force-reload)
1685- #
1686- # If do_reload() is not implemented then leave this commented out
1687- # and leave 'force-reload' as an alias for 'restart'.
1688- #
1689- #log_daemon_msg "Reloading $DESC" "$NAME"
1690- #do_reload
1691- #log_end_msg $?
1692- #;;
1693- restart|force-reload)
1694- #
1695- # If the "reload" option is implemented then remove the
1696- # 'force-reload' alias
1697- #
1698- log_daemon_msg "Restarting $DESC" "$NAME"
1699- do_stop
1700- case "$?" in
1701- 0|1)
1702- do_start
1703- case "$?" in
1704- 0) log_end_msg 0 ;;
1705- 1) log_end_msg 1 ;; # Old process is still running
1706- *) log_end_msg 1 ;; # Failed to start
1707- esac
1708- ;;
1709- *)
1710- # Failed to stop
1711- log_end_msg 1
1712- ;;
1713- esac
1714- ;;
1715- *)
1716- #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
1717- echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
1718- exit 3
1719- ;;
1720-esac
1721-
1722-:
1723
1724=== modified symlink 'platform/hdactl/debian/hdactl.init' (properties changed: -x to +x)
1725=== target was u'../hdactl.initscript.debian'
1726--- platform/hdactl/debian/hdactl.init 1970-01-01 00:00:00 +0000
1727+++ platform/hdactl/debian/hdactl.init 2010-08-08 06:35:52 +0000
1728@@ -0,0 +1,117 @@
1729+#! /bin/sh
1730+#
1731+# This a generated file. DO NOT EDIT THIS FILE!
1732+# If you want to modify how this file works, please
1733+# modify /etc/metainit/hdactl.metainit and re-run update-metainit.
1734+#
1735+# If you are sure that you want to modify this file,
1736+# remove this comment, and update-metainit will not override
1737+# this script any more.
1738+#
1739+### BEGIN INIT INFO
1740+# Provides: hdactl
1741+# Default-Start: 2 3 4 5
1742+# Default-Stop: 1
1743+# Short-Description: Amahi Network Controller
1744+# Required-Start: $syslog $time $local_fs $remote_fs $network $named
1745+# Required-Stop:
1746+# Description: hdactl is a program designed to provide network information for the whole of the Amahi platform.
1747+
1748+### END INIT INFO
1749+
1750+# PATH should only include /usr/* if it runs after the mountnfs.sh script
1751+PATH=/sbin:/usr/sbin:/bin:/usr/bin
1752+DESC=Amahi\ Network\ Controller
1753+NAME=hdactl
1754+DAEMON=/usr/bin/hdactl
1755+BASENAME=hdactl
1756+DAEMON_ARGS=
1757+PIDFILE=/var/run/$NAME.pid
1758+SCRIPTNAME=/etc/init.d/$NAME
1759+# Exit if the package is not installed
1760+[ -x "$DAEMON" ] || exit 5
1761+
1762+# Load the VERBOSE setting and other rcS variables
1763+. /lib/init/vars.sh
1764+
1765+# Define LSB log_* functions.
1766+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
1767+. /lib/lsb/init-functions
1768+
1769+#
1770+# Function that starts the daemon/service
1771+#
1772+do_start()
1773+{
1774+ echo "Starting hdactl";
1775+ start-stop-daemon --start --oknodo --background --quiet --make-pidfile --pidfile $PIDFILE --exec $DAEMON -- \
1776+ $DAEMON_ARGS || return 1
1777+}
1778+
1779+#
1780+# Function that stops the daemon/service
1781+#
1782+do_stop()
1783+{
1784+ start-stop-daemon --stop --oknodo --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $BASENAME
1785+ RETVAL="$?"
1786+
1787+ rm -f $PIDFILE
1788+
1789+ return $RETVAL
1790+ echo "Stopped hdactl";
1791+ return "$RETVAL"
1792+}
1793+
1794+#
1795+# Function that sends a SIGHUP to the daemon/service
1796+#
1797+do_reload() {
1798+ start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
1799+ return 0
1800+}
1801+
1802+case "$1" in
1803+ start)
1804+ [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
1805+ do_start
1806+ log_end_msg $?
1807+ ;;
1808+ stop)
1809+ [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
1810+ do_stop
1811+ log_end_msg $?
1812+ ;;
1813+ #reload|force-reload)
1814+ #
1815+ # If do_reload() is not implemented then leave this commented out
1816+ # and leave 'force-reload' as an alias for 'restart'.
1817+ #
1818+ #log_daemon_msg "Reloading $DESC" "$NAME"
1819+ #do_reload
1820+ #log_end_msg $?
1821+ #;;
1822+ restart|force-reload)
1823+ #
1824+ # If the "reload" option is implemented then remove the
1825+ # 'force-reload' alias
1826+ #
1827+ log_daemon_msg "Restarting $DESC" "$NAME"
1828+ do_stop
1829+ case "$?" in
1830+ 0)
1831+ do_start
1832+ log_end_msg "$?"
1833+ ;;
1834+ *)
1835+ # Failed to stop
1836+ log_end_msg 1
1837+ ;;
1838+ esac
1839+ ;;
1840+ *)
1841+ #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
1842+ echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
1843+ exit 3
1844+ ;;
1845+esac
1846
1847=== removed file 'platform/hdactl/debian/hdactl.install'
1848--- platform/hdactl/debian/hdactl.install 2010-03-29 10:17:37 +0000
1849+++ platform/hdactl/debian/hdactl.install 1970-01-01 00:00:00 +0000
1850@@ -1,29 +0,0 @@
1851-# NOTE (praveen, 2009-06-14): Not including hdactl hda-install.
1852-#Installing init.d scripts this way due to running chkconfig in post inst
1853-
1854-hdactl /usr/bin
1855-hda-install /usr/bin
1856-hda-new-install /usr/bin
1857-hda-settings /usr/bin
1858-hda-alias /usr/bin
1859-hda-install-file /usr/bin
1860-hda-register-apps /usr/bin
1861-hda-change-gw /usr/bin
1862-hda-change-dns /usr/bin
1863-amahi-installer /usr/bin
1864-hda-php-zone-change /usr/bin
1865-hda-install-gem /usr/bin
1866-#hdactrl_hup /usr/bin
1867-# hdactrl.initscript.debian is being handled by dh_installinit dh $@ Calls dh_installinit
1868-hdactl.sysconfig /etc/sysconfig
1869-amahi-hda /usr/share/hdactl
1870-# amahi-installer.initscript is being handled by dh_installinit dh $@ Calls dh_installinit
1871-# Need to research how to install desktop icons should be
1872-web-installer /usr/share/hdactl
1873-httpd /usr/share/hdactl
1874-samba /usr/share/hdactl
1875-vpn /usr/share/hdactl
1876-monit.conf /usr/share/hdactl
1877-
1878-
1879-
1880
1881=== removed file 'platform/hdactl/debian/hdactl.postinst'
1882--- platform/hdactl/debian/hdactl.postinst 2010-03-24 05:38:42 +0000
1883+++ platform/hdactl/debian/hdactl.postinst 1970-01-01 00:00:00 +0000
1884@@ -1,46 +0,0 @@
1885-#!/bin/sh
1886-# -*- shell-script -*-
1887-# postinst script for hda-platform
1888-#
1889-# see: dh_installdeb(1)
1890-
1891-set -e
1892-
1893-# summary of how this script can be called:
1894-# * <postinst> `configure' <most-recently-configured-version>
1895-# * <old-postinst> `abort-upgrade' <new version>
1896-# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
1897-# <new-version>
1898-# * <postinst> `abort-remove'
1899-# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
1900-# <failed-install-package> <version> `removing'
1901-# <conflicting-package> <version>
1902-# for details, see http://www.debian.org/doc/debian-policy/ or
1903-# the debian-policy package
1904-
1905-
1906-case "$1" in
1907- configure)
1908- echo "Configuring shares"
1909- chgrp users /var/hda/files/docs
1910- chgrp users /var/hda/files/pictures
1911- chgrp users /var/hda/files/music
1912- chgrp users /var/hda/files/movies
1913- chgrp users /var/hda/files/books
1914- ;;
1915-
1916- abort-upgrade|abort-remove|abort-deconfigure)
1917- ;;
1918-
1919- *)
1920- echo "postinst called with unknown argument \`$1'" >&2
1921- exit 1
1922- ;;
1923-esac
1924-
1925-# dh_installdeb will replace this with shell code automatically
1926-# generated by other debhelper scripts.
1927-
1928-#DEBHELPER#
1929-
1930-exit 0
1931
1932=== removed file 'platform/hdactl/debian/hdactl.templates'
1933=== added file 'platform/hdactl/debian/install'
1934--- platform/hdactl/debian/install 1970-01-01 00:00:00 +0000
1935+++ platform/hdactl/debian/install 2010-08-08 06:35:52 +0000
1936@@ -0,0 +1,29 @@
1937+# NOTE (praveen, 2009-06-14): Not including hdactl hda-install.
1938+#Installing init.d scripts this way due to running chkconfig in post inst
1939+
1940+hdactl.debian /usr/bin
1941+hda-install /usr/bin
1942+hda-new-install /usr/bin
1943+hda-settings /usr/bin
1944+hda-alias /usr/bin
1945+hda-install-file /usr/bin
1946+hda-register-apps /usr/bin
1947+hda-change-gw /usr/bin
1948+hda-change-dns /usr/bin
1949+amahi-installer.debian /usr/bin
1950+hda-php-zone-change /usr/bin
1951+hda-install-gem /usr/bin
1952+#hdactrl-hup /usr/bin
1953+#hdactrl.initscript /etc/init.d/
1954+hdactl.sysconfig /etc/
1955+amahi-hda /usr/share/hdactl
1956+#amahi-installer.initscript /etc/init.d/
1957+# Need to research how to install desktop icons should be
1958+web-installer /usr/share/hdactl
1959+httpd /usr/share/hdactl
1960+samba /usr/share/hdactl
1961+vpn /usr/share/hdactl
1962+monit.conf /usr/share/hdactl
1963+
1964+
1965+
1966
1967=== added file 'platform/hdactl/debian/postinst'
1968--- platform/hdactl/debian/postinst 1970-01-01 00:00:00 +0000
1969+++ platform/hdactl/debian/postinst 2010-08-08 06:35:52 +0000
1970@@ -0,0 +1,51 @@
1971+#!/bin/sh
1972+# -*- shell-script -*-
1973+# postinst script for hda-platform
1974+#
1975+# see: dh_installdeb(1)
1976+
1977+set -e
1978+
1979+# summary of how this script can be called:
1980+# * <postinst> `configure' <most-recently-configured-version>
1981+# * <old-postinst> `abort-upgrade' <new version>
1982+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
1983+# <new-version>
1984+# * <postinst> `abort-remove'
1985+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
1986+# <failed-install-package> <version> `removing'
1987+# <conflicting-package> <version>
1988+# for details, see http://www.debian.org/doc/debian-policy/ or
1989+# the debian-policy package
1990+
1991+
1992+case "$1" in
1993+ configure)
1994+ echo "Configuring daemons..."
1995+ chgrp users /var/hda/files/backups
1996+ chgrp users /var/hda/files/books
1997+ chgrp users /var/hda/files/docs
1998+ chgrp users /var/hda/files/movies
1999+ chgrp users /var/hda/files/music
2000+ chgrp users /var/hda/files/pictures
2001+ mv /usr/bin/hdactl.debian /usr/bin/hdactl
2002+ mv /usr/bin/amahi-installer.debian /usr/bin/amahi-installer
2003+ echo "Please reboot after install!"
2004+ echo "Please ignore if the package doesn't say it installed correctly"
2005+ ;;
2006+
2007+ abort-upgrade|abort-remove|abort-deconfigure)
2008+ ;;
2009+
2010+ *)
2011+ echo "postinst called with unknown argument \`$1'" >&2
2012+ exit 1
2013+ ;;
2014+esac
2015+
2016+# dh_installdeb will replace this with shell code automatically
2017+# generated by other debhelper scripts.
2018+
2019+#DEBHELPER#
2020+
2021+exit 0
2022
2023=== added file 'platform/hdactl/debian/preinst'
2024--- platform/hdactl/debian/preinst 1970-01-01 00:00:00 +0000
2025+++ platform/hdactl/debian/preinst 2010-08-08 06:35:52 +0000
2026@@ -0,0 +1,10 @@
2027+#!/bin/sh
2028+# -*- shell-script -*-
2029+# preinst script for hdactl
2030+#
2031+# see: dh_installdeb(1)
2032+
2033+#Yes. Seriously. This is all I need to do.
2034+export DEBIAN_FRONTEND=noninteractive
2035+
2036+exit 0
2037
2038=== modified file 'platform/hdactl/debian/rules'
2039--- platform/hdactl/debian/rules 2010-03-24 05:38:42 +0000
2040+++ platform/hdactl/debian/rules 2010-08-08 06:35:52 +0000
2041@@ -5,10 +5,12 @@
2042
2043 override_dh_auto_build:
2044 make hdactl-hup
2045- mv $(CURDIR)/hdactl.debian $(CURDIR)/hdactl
2046- mv $(CURDIR)/hda-install.debian $(CURDIR)/hda-install
2047- dh_auto_install
2048+ #ignore these lines for now, since they'll be merged anyways
2049+ #mv $(CURDIR)/hdactl.debian $(CURDIR)/hdactl
2050+ #mv $(CURDIR)/hda-install.debian $(CURDIR)/hda-install
2051+ make donothing
2052 override_dh_installinit:
2053- dh_installinit --no-start --name=hdactl
2054- dh_installinit --no-start --name=amahi-installer
2055-
2056+ dh_installinit --name=hdactl
2057+ dh_installinit --name=amahi-installer
2058+override_dh_auto_install:
2059+ make donothing
2060
2061=== added file 'platform/hdactl/debian/templates'
2062=== modified file 'platform/hdactl/hda-new-install'
2063--- platform/hdactl/hda-new-install 2010-06-28 23:13:33 +0000
2064+++ platform/hdactl/hda-new-install 2010-08-08 06:35:52 +0000
2065@@ -301,6 +301,32 @@
2066 puts "Network services started."
2067 end
2068
2069+def do_restart_network_ubuntu
2070+ puts "Restarting the network ..."
2071+ do_system_silent "chkconfig network-manager off"
2072+ do_system_silent "service network-manager stop"
2073+ #do_system_silent "killall dhclient"
2074+ sleep 1
2075+ # generate the conf files
2076+ do_system_silent "service hdactl start"
2077+ # stop the net and related services
2078+ do_system_silent "service networking stop"
2079+ sleep 1
2080+ do_system_silent "service bind9 stop"
2081+ #do_system_silent "service named stop"
2082+ sleep 1
2083+ do_system_silent "service networking start"
2084+ puts "Network restart done."
2085+ sleep 1
2086+ puts "Starting network services ..."
2087+ do_system_silent "service hdactl stop"
2088+ sleep 1
2089+ do_system_silent "service hdactl start"
2090+ sleep 2
2091+ do_system_silent "service apache2 start"
2092+ puts "Network services started."
2093+end
2094+
2095 def do_samba
2096 puts "Configuring Samba ... "
2097 substitute "/usr/share/hdactl/samba/", "/etc/samba/"
2098@@ -328,6 +354,14 @@
2099 puts "HTTPD install done."
2100 end
2101
2102+def do_httpd_ubuntu
2103+ puts "Installing httpd ... "
2104+ substitute "/usr/share/hdactl/httpd/", "/etc/apache2/sites-enabled/"
2105+ do_system_silent "a2enmod rewrite dav dav_fs dav_lock"
2106+ do_system_silent "rm -f /etc/apache2/sites-enabled/000-default"
2107+ puts "HTTPD install done."
2108+end
2109+
2110 def start_all_services
2111 puts "Starting services ... "
2112
2113@@ -358,6 +392,31 @@
2114 puts "Stopping unused services done."
2115 end
2116
2117+def start_all_services_ubuntu
2118+ puts "Starting services ... "
2119+
2120+ # NOTE: monit must be the last one, to prevent race conditions
2121+ services_start = [ 'hdactl', 'ddclient', 'apache2', 'bind9', 'networking',
2122+ 'mysql', 'smb', 'nmb', 'monit', 'openvpn', 'hddtemp']
2123+ services_stop = [ 'gpm', 'hplip', 'isdn', 'kudzu', 'sendmail',
2124+ 'unattended-upgrades', 'dhcrelay', 'ldap', 'ufw',
2125+ 'network-manager']
2126+
2127+ services_start.each do |service|
2128+ system "chkconfig --levels 2345 #{service} on 2>&1"
2129+ end
2130+
2131+ puts "Services started."
2132+
2133+ puts "Stopping and disabling unused services ... "
2134+ services_stop.each do |service|
2135+ system "chkconfig --levels 2345 #{service} off 2>&1"
2136+ system "service #{service} stop 2>&1"
2137+ end
2138+
2139+ puts "Stopping unused services done."
2140+end
2141+
2142 def start_service(service)
2143 do_system "service #{service} start"
2144 end
2145@@ -382,11 +441,15 @@
2146 # So we need to fix this first!
2147 def identify_os_broken
2148 distro = "Unknown"
2149- release = "Unknown"
2150- d, r = open("|lsb_release -ir") { |f| f.readlines }
2151- distro = $1 if d =~ /Distributor ID:\t(.*)\n$/
2152- release = $1 if r =~ /Release:\t(.*)\n$/
2153- [distro, release]
2154+ fhos = File.open("/etc/issue", "r")
2155+ os = fhos.readline
2156+ if os["Fedora"]
2157+ distro = "Fedora"
2158+ elsif os["Ubuntu"]
2159+ distro = "Ubuntu"
2160+ end
2161+ fhos.close
2162+ distro
2163 end
2164
2165 def get_arch
2166@@ -487,7 +550,8 @@
2167
2168 def setup_default_homepage
2169
2170- files = Dir.glob "/usr/lib/firefox-*/defaults/preferences/all-redhat.js"
2171+ files = Dir.glob "/usr/lib/firefox-*/defaults/preferences/all-redhat.js" if identify_os_broken == "Fedora"
2172+ files = Dir.glob "/usr/lib/firefox-*/defaults/pref/firefox-branding.js" if identify_os_broken == "Ubuntu"
2173
2174 files.each do |file|
2175
2176@@ -565,7 +629,7 @@
2177 end
2178
2179 def do_install_gems
2180- system "rpm -q rubygem-rails-2.3.4"
2181+ system "dpkg -s rails"
2182 ret = $?
2183 if (ret >> 8)
2184 # not installed
2185@@ -601,14 +665,13 @@
2186 set = ""
2187 rpms.each do |set|
2188
2189- do_system_silent "killall yum-updatesd"
2190+ do_system_silent "killall update-notifier"
2191 message "\t#{set} ..."
2192- puts "YUM INSTALL OF: #{set}";
2193- do_system_silent "killall yum-updatesd"
2194- do_system_silent "killall yum"
2195+ puts "APT INSTALL OF: #{set}";
2196+ do_system_silent "killall update-notifier"
2197
2198- ret = do_system_multiple("yum -y install #{set}")
2199- message "\tWARNING: rpm install failed ... please run\n\tyum -y install #{set}\n\n\tby hand until it installs correctly" unless ret
2200+ ret = do_system_multiple("apt-get -y install #{set}")
2201+ message "\tWARNING: apt-get install failed ... please run\n\tapt-get -y install #{set}\n\n\tby hand until it installs correctly" unless ret
2202
2203 end
2204
2205@@ -848,6 +911,218 @@
2206 message "OK. It is strongly recommended that you reboot your HDA ASAP."
2207 end
2208
2209+def do_full_install_ubuntu(hda)
2210+
2211+ selinux_permissive
2212+
2213+ if File.exists?("/etc/sysconfig/amahi-hda")
2214+ # perhaps not a new install, do nothing unless forced
2215+ unless $OPT["f"]
2216+ message "ERROR: this appears to be initialized."
2217+ message "... use option -f to force complete reinstall."
2218+ exit 1
2219+ end
2220+ end
2221+
2222+ @gem_list = gem_list
2223+
2224+ message "Stopping background software updates ..."
2225+ # stop background yum to prevent waits
2226+ do_system_silent "service unattended-upgrades stop"
2227+ sleep 1
2228+ do_system_silent "killall unattended-upgrades"
2229+ sleep 1
2230+ do_system_silent "killall unattended-upgrades"
2231+ message "Background software updates stopped"
2232+
2233+ setup_default_homepage
2234+
2235+ rpms_to_remove = ["gnome-packagekit", "setroubleshoot setroubleshoot-server setroubleshoot-plugins"]
2236+ rpms_to_remove.each do |rpm|
2237+ do_system_silent "killall unattended-upgrades"
2238+ puts "RPM UNINSTALL OF: #{rpm}";
2239+ ret = do_system_multiple("dpkg -r #{rpm}")
2240+ message "WARNING: rpm uninstall failed ... please run\n\t dpkg -r #{rpm}\n\tby hand until it uninstalls correctly" unless ret
2241+ end
2242+
2243+
2244+ rpms = Array.new
2245+ #Dropping these since this is Ubuntu
2246+ #rpms << "fedora-release yum-fastestmirror"
2247+ rpms << "mysql-server libwww-perl bind9"
2248+ rpms << "php5 php5-mysql dhcp3-server dhcp3-client openvpn monit libauthen-pam-perl"
2249+ rpms << "ruby1.8-dev racc irb1.8 ri1.8"
2250+ rpms << "libdb-ruby1.8 libruby1.8 libruby1.8-extras rdoc1.8 libmysql-ruby1.8"
2251+ rpms << "eruby liberuby rdoc1.8 hddtemp libaugeas-ruby1.8"
2252+ rpms << "rubygems1.8 libgemplugin-ruby1.8"
2253+ rpms << "libvalidatable-ruby1.8 ruby1.8-dev"
2254+ rpms << "rails rake"
2255+ # NOTE: these below are needed for F12 and Ubuntu
2256+ rpms << "rails rake libboost-all-dev"
2257+ rpms << "libapache2-mod-passenger"
2258+ rpms << "build-essential"
2259+
2260+ #message "Installing required packages (this may take a while depending on your download speed) ... "
2261+ rpms.each do |set|
2262+ do_system_silent "killall unattended-updates"
2263+ do_system_silent "export DEBIAN_FRONTEND=noninteractive"
2264+ message "Installing #{set} ..."
2265+ puts "APT INSTALL OF: #{set}";
2266+ ret = do_system_multiple("apt-get -y -q install #{set}")
2267+ message "WARNING: rpm install failed ... please run\n\t apt-get -y install #{set}\n\tby hand until it installs correctly" unless ret
2268+ end
2269+
2270+ message "APT packages installed"
2271+
2272+ #Install rubygems that were missing from repos
2273+ igems = Array.new
2274+ igems << "actionmailer"
2275+ igems << "actionpack"
2276+ igems << "activerecord"
2277+ igems << "activeresource"
2278+ igems << "activesupport"
2279+ igems << "hoe"
2280+ igems << "pluginfactory"
2281+ igems << "rubyforge"
2282+ igems << "gruff"
2283+ igems << "gd2"
2284+ igems << "fastthread"
2285+
2286+ igems.each do |set|
2287+ message "Installing #{set} rubygem..."
2288+ install_gem(set,nil)
2289+ end
2290+
2291+ message "Installing oddball rack 1.0.0..."
2292+ install_gem("rack","1.0.0")
2293+
2294+ message "Installing rails 2.3.4"
2295+ install_gem("rails","2.3.4")
2296+
2297+ message "Ruby Gems installed"
2298+
2299+ message "Starting MySQL"
2300+ do_system_silent "service mysql start"
2301+ sleep 2
2302+
2303+ # disable DNSSEC
2304+ #disable_dnssec
2305+
2306+ message "Initializing MySQL"
2307+
2308+ # initialize mysql
2309+ initialize_mysql
2310+
2311+ # install stuff for rails
2312+ # message "Installing Ruby Gems (may take a while depending on your server speed)."
2313+ # we already did this for ubuntu, commenting out for now
2314+ #do_install_gems() unless $OPT["r"]
2315+
2316+ # initialize rails and database
2317+ message "Initializing Ruby on Rails and DB"
2318+ do_system_silent "cd /var/hda/platform/html; rake db:migrate RAILS_ENV=production"
2319+
2320+ # update DB with remote data
2321+ message "Activating your HDA's settings"
2322+ copy_remote_db_configuration hda
2323+
2324+ sleep 1
2325+
2326+ # use the HDA data from the local db now
2327+ db_connect
2328+
2329+ # but autoconfigure the network first
2330+ autoconfigure_network
2331+
2332+ message "Initializing settings"
2333+
2334+ # load db settings
2335+ get_db_settings
2336+
2337+ message "Setting up watchdog monitor"
2338+ do_monit
2339+
2340+ # set php timezone
2341+ do_php_timezone
2342+
2343+ # instantiate /etc/sysconfig/amahi-hda
2344+ substitute "/usr/share/hdactl/amahi-hda", "/etc/amahi-hda"
2345+
2346+ # lockdown f12 user install of software
2347+ # not needed in ubuntu, commenting out
2348+ #do_fedora12_lockdown
2349+
2350+ # samba configuration
2351+ message "Starting SAMBA server ..."
2352+ do_samba
2353+
2354+ # vpn configuration
2355+ message "Starting VPN server ..."
2356+ do_vpn
2357+
2358+ # http configuration
2359+ message "Starting HTTP server ..."
2360+ do_httpd_ubuntu
2361+
2362+
2363+ # desktop icons - broken for some reason in ubuntu
2364+ #do_desktop_icons
2365+
2366+ # restart the network and the rest of the services
2367+ message "Restarting the network ..."
2368+ do_restart_network_ubuntu
2369+
2370+ # NOTE: important to do this before the apps are
2371+ # installed
2372+ mark_as_installed
2373+
2374+ # This is being phased out!
2375+ # message "Installing HDA apps\n\t(may take a while depending on your download speed)."
2376+ # install_amahi_apps
2377+
2378+ # let the games begin!
2379+ message "Starting the rest of the services ..."
2380+ start_all_services_ubuntu
2381+
2382+ sleep 2
2383+
2384+ #disable_selinux
2385+
2386+ #disable_firewall
2387+
2388+ do_network_ubuntu
2389+
2390+ puts "****************************************************\n"
2391+ puts " Amahi installed successfully! Please reboot it!\n"
2392+ puts " Amahi installed successfully! Please reboot it!\n"
2393+ puts "****************************************************\n"
2394+
2395+ if $OPT["q"]
2396+ # indicate we're done to the automated installer
2397+ message ("Instalation completed! Please reboot your HDA and all your computers!" * 4)
2398+ return
2399+ end
2400+
2401+ final_message2
2402+
2403+ message "\nThe system needs to reboot for your settings to take effect."
2404+ message "\nWould you like to reboot now? (strongly recommended)? (yes/no)?"
2405+
2406+
2407+ system "reboot" if $OPT["y"]
2408+
2409+ resp = $stdin.gets
2410+
2411+ if resp != nil
2412+ if resp =~ /(y|yes)/
2413+ system "sync; sync; reboot"
2414+ exit 0 # just in case
2415+ end
2416+ end
2417+
2418+ message "OK. It is strongly recommended that you reboot your HDA ASAP."
2419+end
2420+
2421 def final_message2
2422
2423 message "\nCongratulations! Your Amahi HDA is set up!\n"
2424@@ -961,6 +1236,65 @@
2425
2426 end
2427
2428+def do_network_ubuntu
2429+
2430+ message "Configuring your network (eth0)."
2431+
2432+ netmask = @settings['netmask']
2433+ self_address = @settings['self-address']
2434+ domain = @settings['domain']
2435+ net = @settings['net']
2436+ nick = @settings['nick']
2437+ id = @settings['hda-id']
2438+ gw = @settings['gateway']
2439+ dns1 = @settings['external-dns1']
2440+ dns2 = @settings['external-dns2']
2441+
2442+ # do this to prevent NM from overtaking the changes!
2443+ do_system_silent "service network-manager stop"
2444+
2445+ ifcfg = "/etc/network/interfaces"
2446+
2447+ ifcfg_fh = nil
2448+ begin
2449+
2450+
2451+ begin
2452+ #FIXME:Changed to w+ for OVERWRITE! We may not want to do this!
2453+ ifcfg_fh = File.new ifcfg, "w+"
2454+ rescue
2455+ abort "cannot open file #{ifcfg}: #{$!}"
2456+ end
2457+
2458+ # Fun Ubuntu changes right here.
2459+ ifcfg_fh.syswrite "auto eth0 lo\niface lo inet loopback\n\niface eth0 inet static\n"
2460+ ifcfg_fh.syswrite "address #{net}.#{self_address}\nnetmask #{netmask}\nnetwork #{net}.0\nbroadcast #{net}.255\ngateway #{net}.#{gw}"
2461+
2462+ rescue
2463+ abort "cannot open '#{ifcfg}' for reading: #{$!}"
2464+ ensure
2465+ ifcfg_fh.close if ifcfg_fh != nil
2466+ end
2467+
2468+ rslv = "/etc/resolv.conf"
2469+ rslv_fh = nil
2470+ begin
2471+ rslv_fh = File.new rslv, "w"
2472+ rslv_fh.puts "search #{domain}"
2473+ rslv_fh.puts "nameserver #{net}.#{self_address}"
2474+ rslv_fh.puts "nameserver #{dns1}"
2475+ rslv_fh.puts "nameserver #{dns2}"
2476+ rescue
2477+ abort "cannot open '#{rslv}' for writing: #{$!}"
2478+ ensure
2479+ rslv_fh.close if rslv_fh != nil
2480+ end
2481+
2482+ # ensure it's readable!
2483+ File.chmod 0644, rslv
2484+
2485+end
2486+
2487 def disable_firewall
2488
2489 message "Disabling firewall.\n"
2490@@ -1022,7 +1356,7 @@
2491 require 'augeas'
2492
2493 message "Setting up global PHP timezone ..."
2494- Augeas::open do |aug|
2495+ Augeas::open("/",nil,0) do |aug|
2496 zone = aug.get("/files/etc/sysconfig/clock/ZONE")
2497 #puts "ZONE = #{zone}"
2498 # FIXME - we should also record it in the user settings! wether we get it or not from the clock file
2499@@ -1188,6 +1522,55 @@
2500 end
2501 end
2502
2503+def do_basic_checks_ubuntu
2504+ ENV["PATH"] += ":/sbin:/usr/sbin:/bin"
2505+
2506+ ruid = Process.uid
2507+ euid = Process.euid
2508+
2509+ if euid != 0
2510+ puts "ERROR: this program must be run as \"root\". type \"su\" (to Switch User to root),"
2511+ puts " then input your root password, then do the install again.\n"
2512+ puts " \$ su"
2513+ puts " Password: (your root password)"
2514+ puts " # hda-install YOUR_INSTALL_CODE"
2515+ exit 1
2516+ end
2517+
2518+ if File.exists?("/etc/amahi-hda")
2519+ # perhaps not a new install, do nothing unless forced
2520+ unless $OPT["f"]
2521+ puts "ERROR: this HDA appears to be installed already."
2522+ puts " Remove the file /etc/amahi-hda to force reinstall."
2523+ exit 1
2524+ end
2525+ g = nil
2526+ begin
2527+ g = open('http://www.yahoo.com/').read
2528+ rescue
2529+ g = nil
2530+ end
2531+
2532+ unless g
2533+ (1..3).each do
2534+ do_system_silent "service monit stop"
2535+ do_system_silent "service hdactl stop"
2536+ do_system_silent "service bind9 stop"
2537+ do_system_silent "killall dhclient"
2538+ sleep 1
2539+ do_system_silent "dhclient eth0"
2540+ sleep 1
2541+ begin
2542+ g = open('http://www.yahoo.com/').read
2543+ rescue
2544+ g = nil
2545+ end
2546+ break if g != nil
2547+ end
2548+ end
2549+ end
2550+end
2551+
2552 def do_fedora12_lockdown
2553 # FIXME - make this not apply for other distro releases
2554 # as appropriate
2555@@ -1214,8 +1597,11 @@
2556 usage unless ARGV.size > 0
2557
2558 inst_code = ARGV[0]
2559+
2560+ distrocode = identify_os_broken
2561
2562- do_basic_checks
2563+ do_basic_checks if (distrocode = "Fedora")
2564+ do_basic_checks_ubuntu if (distrocode = "Ubuntu")
2565
2566 set_standard_out
2567
2568@@ -1242,7 +1628,8 @@
2569 return
2570 end
2571
2572- do_full_install inst_code
2573+ do_full_install inst_code if (distrocode = "Fedora")
2574+ do_full_install_ubuntu inst_code if (distrocode = "Ubuntu")
2575 end
2576
2577 main
2578
2579=== modified file 'platform/hdactl/hda-new-install.debian' (properties changed: +x to -x)
2580=== modified file 'platform/hdactl/hdactl' (properties changed: +x to -x)
2581=== modified file 'platform/hdactl/hdactl.debian'
2582--- platform/hdactl/hdactl.debian 2009-11-27 07:39:21 +0000
2583+++ platform/hdactl/hdactl.debian 2010-08-08 06:35:52 +0000
2584@@ -19,8 +19,15 @@
2585
2586 # FIXME only eth0 supported for now - moving to do more
2587 my $device = "eth0";
2588-
2589-my $version = "2.40";
2590+# To enable DNS resolution secondary via OpenDNS,
2591+# set the line below to 1
2592+my $use_opendns_secondary = 0;
2593+# this is for the very few users with a different netmask
2594+my $netmask_size = 24;
2595+
2596+
2597+my $version = "3.4.3";
2598+
2599
2600 my $DATABASE_NAME = "hda_production";
2601 my $DATABASE_USER = "amahihda";
2602@@ -33,6 +40,8 @@
2603 my $period = 600; # run period, in seconds
2604 my $cmdfile = "/tmp/.hdactl.s";
2605
2606+my $platform = "EE";
2607+
2608 ## process args
2609 my $programd = $0;
2610 $programd =~ s%^.*/%%;
2611@@ -61,7 +70,7 @@
2612 my $file_hda = "hda.conf"; # "void" file
2613 my $file_dhcpd = "dhcpd.conf";
2614 my $file_resolv = "resolv.conf";
2615-my $file_ifcfg = "ifcfg-$device";
2616+my $file_ifcfg = "interfaces";
2617
2618 my $ifcfg_idx = 1;
2619 my $dump_mode = 0;
2620@@ -116,7 +125,7 @@
2621 }
2622
2623 sub get_named_settings {
2624- open(my $named, "<", "/etc/sysconfig/named") or return;
2625+ open(my $named, "<", "/etc/bind") or return;
2626
2627 while (<$named>) {
2628 next if /^\s*#/; # skip options
2629@@ -154,26 +163,10 @@
2630 or &logdie($DBI::errstr);
2631 }
2632
2633-
2634 sub db_disconnect {
2635 $dbh->disconnect();
2636 }
2637
2638-sub print_named_conf_hosts {
2639- my $file = shift;
2640-
2641- my $sth = $dbh->prepare("SELECT Domain FROM privacies order by Domain");
2642- $sth->execute();
2643-
2644- my @row = ();
2645- while ( @row = $sth->fetchrow_array ) {
2646- printf $file "zone \"%s\" IN { ", $row[0];
2647- printf $file "type master; notify no; file \"%s\"; ", $file_hda;
2648- printf $file "};\n";
2649- }
2650- $sth->finish();
2651-}
2652-
2653 sub print_named_conf {
2654
2655 open(my $hda, ">", $file_named);
2656@@ -207,13 +200,20 @@
2657 printf $hda "# automatically generated file by hdactl\n";
2658 printf $hda "options {\n";
2659 printf $hda "\tlisten-on-v6 port 53 { ::1; };\n";
2660- printf $hda "\tdirectory \"/var/named\";\n";
2661- printf $hda "\tdump-file \"/var/named/data/cache_dump.db\";\n";
2662- printf $hda "\tstatistics-file \"/var/named/data/named_stats.txt\";\n";
2663- printf $hda "\tmemstatistics-file \"/var/named/data/named_mem_stats.txt\";\n";
2664+ printf $hda "\tdirectory \"/var/cache/bind\";\n";
2665+ printf $hda "\tdump-file \"/var/cache/bind/cache_dump.db\";\n";
2666+ printf $hda "\tstatistics-file \"/var/cache/bind/named_stats.txt\";\n";
2667+ printf $hda "\tmemstatistics-file \"/var/cache/bind/named_mem_stats.txt\";\n";
2668 printf $hda "\tforward only;\n";
2669 printf $hda "\tforwarders { %s; %s };\n", $extdns1, $extdns2;
2670 printf $hda "\tlisten-on port 53 { %s; 127.0.0.1; };\n", $self;
2671+ printf $hda "\tallow-query { trusted; };\n";
2672+ printf $hda "};\n";
2673+
2674+ printf $hda "acl trusted {\n";
2675+ printf $hda "\tlocalhost;\n";
2676+ printf $hda "\t10.8.0.0/24;\n";
2677+ printf $hda "\t%s/%s;\n", $full_net, $netmask_size;
2678 printf $hda "};\n";
2679
2680 printf $hda "logging {\n";
2681@@ -244,7 +244,7 @@
2682 printf $hda "zone \"%s\" IN {\n", $domain;
2683 printf $hda "\ttype master;\n";
2684 printf $hda "\tnotify no;\n";
2685- printf $hda "\tfile \"dynamic/%s\";\n", $file_n2a;
2686+ printf $hda "\tfile \"%s\";\n", $file_n2a;
2687 printf $hda "\tallow-update { key ddnskey; };\n";
2688 printf $hda "\tcheck-names ignore;\n";
2689 printf $hda "};\n\n";
2690@@ -253,12 +253,10 @@
2691 printf $hda "zone \"%s\" IN {\n", &reverse_net($net);
2692 printf $hda "\ttype master;\n";
2693 printf $hda "\tnotify no;\n";
2694- printf $hda "\tfile \"dynamic/%s\";\n", $file_a2n;
2695+ printf $hda "\tfile \"%s\";\n", $file_a2n;
2696 printf $hda "\tallow-update { key ddnskey; };\n";
2697 printf $hda "\tcheck-names ignore;\n";
2698 printf $hda "};\n\n";
2699-
2700- &print_named_conf_hosts ($hda);
2701 }
2702
2703 sub print_void_info {
2704@@ -272,13 +270,13 @@
2705 my $serial = sprintf("%02d%02d%02d%02d%02d", $year, $mon, $mday, $hour, $min);
2706
2707 printf $void "\$TTL 86400\n";
2708- printf $void "@ IN SOA %s. root.%s. (\n", $domain, $domain;
2709+ printf $void "@ IN SOA hda.%s. root.%s. (\n", $domain, $domain;
2710 printf $void "\t%s ; Serial\n", $serial;
2711 printf $void "\t28800 ; Refresh\n";
2712 printf $void "\t14400 ; Retry\n";
2713 printf $void "\t3600000 ; Expire\n";
2714 printf $void "\t86400 ) ; Minimum\n";
2715- printf $void "\t\tIN NS %s.\n", $void_host;
2716+ printf $void "\t\tIN NS hda.%s.\n", $void_host;
2717 printf $void "\t\tIN A %s\n", $void_host;
2718 printf $void "*\tIN A %s\n", $void_host;
2719 printf $void "\n";
2720@@ -302,6 +300,10 @@
2721 $host[$address] = $name;
2722 }
2723 }
2724+
2725+ # Hard-code the hostname for the HDA to 'hda'
2726+ $host[int($settings{'self-address'})] = "hda";
2727+
2728 $sth->finish();
2729 }
2730
2731@@ -362,15 +364,15 @@
2732 my $net = $settings{'net'};
2733
2734 printf $name2addr "\$TTL 86400\n";
2735- printf $name2addr "@ IN SOA %s. root.%s. (\n", $domain, $domain;
2736+ printf $name2addr "@ IN SOA hda.%s. root.%s. (\n", $domain, $domain;
2737 printf $name2addr "\t%s ; Serial\n", $serial;
2738 printf $name2addr "\t28800 ; Refresh\n";
2739 printf $name2addr "\t14400 ; Retry\n";
2740 printf $name2addr "\t3600000 ; Expire\n";
2741 printf $name2addr "\t86400 ) ; Minimum\n";
2742- printf $name2addr "\t\tIN NS %s.\n", $domain;
2743- printf $name2addr "\t\tIN MX 10 %s.\n", $domain;
2744- printf $name2addr "*\tIN MX 10 %s.\n", $domain;
2745+ printf $name2addr "\t\tIN NS hda.%s.\n", $domain;
2746+ printf $name2addr "\t\tIN MX 10 hda.%s.\n", $domain;
2747+ printf $name2addr "*\tIN MX 10 hda.%s.\n", $domain;
2748 printf $name2addr "\n";
2749
2750 foreach my $i (1 .. 254) {
2751@@ -392,15 +394,15 @@
2752 my $net = $settings{'net'};
2753
2754 printf $addr2name "\$TTL 86400\n";
2755- printf $addr2name "@ IN SOA %s. root.%s. (\n", $domain, $domain;
2756+ printf $addr2name "@ IN SOA hda.%s. root.%s. (\n", $domain, $domain;
2757 printf $addr2name "\t%s ; Serial\n", $serial;
2758 printf $addr2name "\t28800 ; Refresh\n";
2759 printf $addr2name "\t14400 ; Retry\n";
2760 printf $addr2name "\t3600000 ; Expire\n";
2761 printf $addr2name "\t86400 ) ; Minimum\n";
2762- printf $addr2name "\t\tIN NS %s.\n", $domain;
2763- printf $addr2name "\t\tIN MX 10 %s.\n", $domain;
2764- printf $addr2name "*\tIN MX 10 %s.\n", $domain;
2765+ printf $addr2name "\t\tIN NS hda.%s.\n", $domain;
2766+ printf $addr2name "\t\tIN MX 10 hda.%s.\n", $domain;
2767+ printf $addr2name "*\tIN MX 10 hda.%s.\n", $domain;
2768 printf $addr2name "\n";
2769
2770 foreach my $i (1 .. 254) {
2771@@ -460,13 +462,17 @@
2772 }
2773
2774 # FIXME: error checking!
2775- &mv ($file_named, $prefix . "/etc");
2776- &mv ($file_hda, $prefix . "/var/named");
2777- &mv ($file_n2a, $prefix . "/var/named/dynamic");
2778- &mv ($file_a2n, $prefix . "/var/named/dynamic");
2779+ &mv ($file_named, $prefix . "/etc/bind");
2780+ &mv ($file_hda, $prefix . "/var/cache/bind/");
2781+ &mv ($file_n2a, $prefix . "/var/cache/bind/");
2782+ &mv ($file_a2n, $prefix . "/var/cache/bind/");
2783
2784 # no prefix for dhcpd conf file
2785- &mv ($file_dhcpd, "/etc");
2786+ my $dhcp_path = "/etc/dhcp3";
2787+
2788+ #$dhcp_path = "/etc" if ($platform eq "F10");
2789+
2790+ &mv ($file_dhcpd, $dhcp_path);
2791 # &mv ($file_resolv, "/etc");
2792 }
2793
2794@@ -515,29 +521,10 @@
2795 my $dns1 = $settings{'external-dns1'};
2796 my $dns2 = $settings{'external-dns2'};
2797
2798- my $ifcfg = "/etc/network/interfaces";
2799-
2800- my $ifcfg_fh=IO::File->new("> $ifcfg") or &logdie("cannot open file $ifcfg: $!");
2801- $ifcfg_fh->sysseek(0, 0);
2802-
2803- my $header = "# Generated by hdactl on " . strftime("%Y-%m-%d %H:%M:%S", localtime) . " / " . $ifcfg_idx++;
2804- $ifcfg_fh->syswrite("$header\n" .
2805- "auto lo $device\n\n" .
2806- "iface lo inet loopback\n\n" .
2807- "iface $device inet static\n" .
2808- " address $net.$self\n" .
2809- " netmask $netmask\n" .
2810- " gatway $net.$gw\n");
2811- $ifcfg_fh->close;
2812-
2813- my $rslv = "/etc/resolv.conf";
2814- open (my $RSLV, "> $rslv") or &logdie("cannot open '$rslv' for writing: $!");
2815- printf $RSLV "search $domain\n";
2816- printf $RSLV "nameserver $net.$self\n";
2817- close $RSLV;
2818-
2819- # ensure it's readable!
2820- chmod 0644, $rslv;
2821+ my $prefix = "/etc/network";
2822+ my $ifcfg = "$prefix/$file_ifcfg";
2823+
2824+
2825 }
2826
2827 sub print_dhcp_conf {
2828@@ -550,7 +537,7 @@
2829 my $dyn_lo = $net . ".100";
2830 my $dyn_hi = $net . ".254";
2831 my $rev_net = &reverse_net ($net);
2832-
2833+ my $time_offset = &get_time_offset();
2834 open(my $dhcpd, ">", $file_dhcpd);
2835
2836 printf $dhcpd "ddns-update-style interim;\n";
2837@@ -568,8 +555,12 @@
2838 printf $dhcpd "\toption routers %s;\n", $gw;
2839 printf $dhcpd "\toption subnet-mask %s;\n", $settings{'netmask'};
2840 printf $dhcpd "\toption domain-name \"%s\";\n", $settings{'domain'};
2841- printf $dhcpd "\toption domain-name-servers %s;\n", $dns1;
2842- printf $dhcpd "\toption time-offset -9;\n"; # FIXME: time zone
2843+ if ($use_opendns_secondary) {
2844+ printf $dhcpd "\toption domain-name-servers %s, %s;\n", $dns1, $settings{'external-dns1'};
2845+ } else {
2846+ printf $dhcpd "\toption domain-name-servers %s, %s;\n", $dns1, $dns1;
2847+ }
2848+ printf $dhcpd "\toption time-offset %s;\n", $time_offset;
2849 printf $dhcpd "\trange %s %s;\n", $dyn_lo, $dyn_hi;
2850 printf $dhcpd "\tdefault-lease-time %s;\n",$settings{'dhcp_lease_time'};
2851 printf $dhcpd "\tmax-lease-time %s;\n",$settings{'dhcp_lease_time'};
2852@@ -597,14 +588,12 @@
2853
2854 sub generate_files {
2855
2856- &db_connect ();
2857 &get_db_settings();
2858 &print_dhcp_conf ();
2859 &print_network ();
2860 &get_named_settings();
2861 &print_named_conf ();
2862 &print_domain_info ();
2863- &db_disconnect ();
2864 &move_files();
2865 }
2866
2867@@ -617,10 +606,23 @@
2868 printf "Quitting ...\n";
2869 exit (1);
2870 }
2871-
2872-}
2873-
2874-### start of the daemon code
2875+ $platform = &get_platform();
2876+}
2877+
2878+# FIXME support ubuntu too
2879+sub get_platform {
2880+ open (my $file, "< /etc/legal") or
2881+ return "F$1";
2882+ my $p = <$file>;
2883+ chomp $p;
2884+ if ($p =~ /Fedora release (\w+)/) {
2885+ return "EE"
2886+ }
2887+
2888+ return "EE";
2889+}
2890+
2891+### detach ourselves as a daemon
2892
2893 sub fork_daemon {
2894
2895@@ -629,8 +631,10 @@
2896 print STDERR "${program}: can not fork ($!)\n";
2897 exit -1;
2898 } elsif ($pid) {
2899+ # parent simply exit
2900 exit 0;
2901 }
2902+ # chil continues execution
2903 $SIG{'CHLD'} = 'DEFAULT';
2904 open(STDOUT, ">/dev/null");
2905 open(STDERR, ">/dev/null");
2906@@ -645,14 +649,13 @@
2907
2908 sub write_pid {
2909
2910- if ($pidfile) {
2911- local *FD;
2912- if (! open(FD, "> $pidfile")) {
2913- &log ("Cannot create file '$pidfile'. ($!)");
2914- } else {
2915- printf FD "$$\n";
2916- close(FD);
2917- }
2918+ return unless ($pidfile);
2919+ local *FD;
2920+ if (! open(FD, "> $pidfile")) {
2921+ &log ("Cannot create file '$pidfile'. ($!)");
2922+ } else {
2923+ printf FD "$$\n";
2924+ close(FD);
2925 }
2926 }
2927
2928@@ -682,11 +685,40 @@
2929 &do_periodic_update();
2930 }
2931
2932+sub check_service
2933+{
2934+ my $service = shift;
2935+
2936+ my $sth = $dbh->prepare('SELECT start_at_boot from `servers` WHERE `name` = ?; ')
2937+ or &logdie("Couldn't prepare statement: " . $dbh->errstr);
2938+ $sth->execute($service);
2939+ my @data = $sth->fetchrow_array();
2940+
2941+ my $result = 1;
2942+ if (@data) {
2943+ $result = ($data[0] == 1);
2944+ if ($result) {
2945+ &log ("$service is enabled")
2946+ } else {
2947+ &log ("$service is disabled")
2948+ }
2949+ } else {
2950+ # default to enabled, cause the service is not there!
2951+ $result = 1;
2952+ &log ("$service setting is not present - defaulting to enabled")
2953+ }
2954+ return $result;
2955+}
2956+
2957 sub restart_named {
2958- if (system("service named restart >& /dev/null")) {
2959- &log ("cannot restart named");
2960+ if (&check_service("bind9")) {
2961+ if (system("service bind9 restart >& /dev/null")) {
2962+ &log ("cannot restart bind9");
2963+ } else {
2964+ &log ("bind9 restarted successfully");
2965+ }
2966 } else {
2967- &log ("named restarted successfully");
2968+ &log("bind9 not enabled");
2969 }
2970 }
2971
2972@@ -694,7 +726,7 @@
2973
2974 my $g = get("http://www.yahoo.com");
2975 if (!defined($g)) {
2976- if (system("service network restart >& /dev/null")) {
2977+ if (system("service networking restart >& /dev/null")) {
2978 &log ("cannot restart network");
2979 } else {
2980 &log ("network restarted successfully");
2981@@ -705,7 +737,7 @@
2982 sub get_os_version {
2983 if (-e '/etc/system-release') {
2984
2985- open (my $file, "< /etc/system-release") or
2986+ open (my $file, "< /etc/legal") or
2987 return uri_escape("cannot-open-sys-release-file");
2988 my $f = <$file>;
2989 chomp $f;
2990@@ -723,36 +755,43 @@
2991 }
2992
2993 sub restart_dhcpd {
2994- if (system("service dhcpd stop >& /dev/null")) {
2995- &log ("cannot stop dhcpd");
2996- } else {
2997- &log ("dhcpd stopped successfully");
2998- }
2999-
3000- # FIXME: error checking!
3001- unlink ("/var/lib/dhcpd/dhcpd.leases");
3002-
3003- if (system("service dhcpd start >& /dev/null")) {
3004- &log ("cannot start dhcpd");
3005- } else {
3006- &log ("dhcpd started successfully");
3007+ if(&check_service("dhcp3-server")){
3008+ if (system("service dhcp3-server stop >& /dev/null")) {
3009+ &log ("cannot stop dhcp3-server");
3010+ } else {
3011+ &log ("dhcp3-server stopped successfully");
3012+ }
3013+
3014+ # FIXME: error checking!
3015+ #unlink ("/var/lib/dhcpd/dhcpd.leases");
3016+
3017+ if (system("service dhcp3-server start >& /dev/null")) {
3018+ &log ("cannot start dhcp3-server");
3019+ } else {
3020+ &log ("dhcp3-server started successfully");
3021+ }
3022+ } else {
3023+ &log("dhcp3-server not enabled");
3024 }
3025 }
3026
3027 sub do_hup_action {
3028 &log ("caught SIGHUP: executing programmed action.");
3029
3030+ &db_connect();
3031 &generate_files ();
3032-
3033 &restart_named ();
3034 &restart_dhcpd ();
3035+ &db_disconnect ();
3036
3037 &log ("services restarted");
3038 }
3039
3040 sub dump_mode {
3041 $dump_mode = 1;
3042+ &db_connect();
3043 &generate_files ();
3044+ &db_disconnect();
3045 exit (0);
3046 }
3047
3048@@ -803,7 +842,8 @@
3049 return -1;
3050 }
3051
3052- while(1) {
3053+ &log("command fifo starting ...");
3054+ while (!$caught_term) {
3055 # serve one at a time
3056 while (accept(CLIENT, SERV)) {
3057 CLIENT->autoflush(1);
3058@@ -820,8 +860,9 @@
3059 }
3060 close (CLIENT);
3061 }
3062- &log("WARNING: accept failed with: $!");
3063+ &log("WARNING: accept failed with: $!") unless $caught_term;
3064 }
3065+ &log("caught SIGTERM: command fifo terminating.");
3066 unlink $cmdfile;
3067 return 0;
3068 }
3069@@ -851,6 +892,27 @@
3070 exit (0);
3071 }
3072
3073+sub get_time_offset {
3074+ my $wasnegative = 0;
3075+
3076+ open TIME, "date +%z |" or &logdie("Failed to open pipe in get_time_offset: $!");
3077+ my $time = <TIME>;
3078+
3079+ if ($time < 0){
3080+ $wasnegative = 1;
3081+ $time *= -1;
3082+ }
3083+ $time =~ s/0//g;
3084+
3085+ my $timeoffset = $time * 3600;
3086+
3087+ if ($wasnegative){
3088+ $timeoffset *= -1;
3089+ }
3090+
3091+ return $timeoffset;
3092+}
3093+
3094 sub main {
3095
3096 &usage() if (defined($opt_h));
3097@@ -866,9 +928,11 @@
3098
3099 # FIXME - this will reset the settings from the DB at
3100 # every reboot
3101+ &db_connect ();
3102 &generate_files ();
3103 &restart_named ();
3104 &restart_dhcpd ();
3105+ &db_disconnect ();
3106
3107 umask 077;
3108 do {
3109@@ -892,7 +956,7 @@
3110
3111 } while (!$caught_term);
3112
3113- &log ("caught SIGTERM; exiting hdactl v$version.") if $caught_term;
3114+ &log ("caught SIGTERM: exiting hdactl v$version.") if $caught_term;
3115 &unlink_files();
3116 kill('TERM', $command_processor_pid);
3117
3118
3119=== added file 'platform/hdactl/hdactl.metainit'
3120--- platform/hdactl/hdactl.metainit 1970-01-01 00:00:00 +0000
3121+++ platform/hdactl/hdactl.metainit 2010-08-08 06:35:52 +0000
3122@@ -0,0 +1,7 @@
3123+Short-Description: Amahi Network Controller
3124+Description: hdactl is a program designed to provide network information for the whole of the Amahi platform.
3125+Exec: /usr/bin/hdactl
3126+Required-Start: $syslog $time $local_fs $remote_fs $network $named
3127+Required-Stop:
3128+Prestart-Hook: echo "Starting hdactl";
3129+Poststop-Hook: echo "Stopped hdactl";
3130
3131=== modified file 'platform/hdactl/vpn-client/mac/Amahi VPN Client Configuration.pkg/Contents/Packages/library.pkg/Contents/Archive.bom' (properties changed: +x to -x)
3132=== modified file 'platform/hdactl/vpn-client/mac/Amahi VPN Client Configuration.pkg/Contents/Packages/library.pkg/Contents/Archive.pax.gz' (properties changed: +x to -x)
3133=== modified file 'platform/hdactl/vpn-client/mac/Amahi VPN Client Configuration.pkg/Contents/Packages/library.pkg/Contents/Info.plist' (properties changed: +x to -x)
3134=== modified file 'platform/hdactl/vpn-client/mac/Amahi VPN Client Configuration.pkg/Contents/Packages/library.pkg/Contents/PkgInfo' (properties changed: +x to -x)
3135=== modified file 'platform/hdactl/vpn-client/mac/Amahi VPN Client Configuration.pkg/Contents/Packages/library.pkg/Contents/Resources/en.lproj/Description.plist' (properties changed: +x to -x)
3136=== modified file 'platform/hdactl/vpn-client/mac/Amahi VPN Client Configuration.pkg/Contents/Packages/library.pkg/Contents/Resources/package_version' (properties changed: +x to -x)
3137=== modified file 'platform/hdactl/vpn-client/mac/Amahi VPN Client Configuration.pkg/Contents/Packages/library.pkg/Contents/Resources/postflight' (properties changed: +x to -x)
3138=== modified file 'platform/hdactl/vpn-client/mac/Amahi VPN Client Configuration.pkg/Contents/Packages/library.pkg/Contents/Resources/postinstall' (properties changed: +x to -x)
3139=== modified file 'platform/hdactl/vpn-client/mac/Amahi VPN Client Configuration.pkg/Contents/distribution.dist' (properties changed: +x to -x)
3140=== modified file 'platform/hdactl/vpn-client/mac/Amahi VPN Client Configuration.pmdoc/01library-contents.xml' (properties changed: +x to -x)
3141=== modified file 'platform/hdactl/vpn-client/mac/Amahi VPN Client Configuration.pmdoc/01library.xml' (properties changed: +x to -x)
3142=== modified file 'platform/hdactl/vpn-client/mac/Amahi VPN Client Configuration.pmdoc/index.xml' (properties changed: +x to -x)
3143=== modified file 'platform/hdactl/vpn-client/mac/Library/openvpn/AmahiHDAClient.crt' (properties changed: +x to -x)
3144=== modified file 'platform/hdactl/vpn-client/mac/Library/openvpn/AmahiHDAClient.key' (properties changed: +x to -x)
3145=== modified file 'platform/hdactl/vpn-client/mac/Library/openvpn/MyHDA.conf' (properties changed: +x to -x)
3146=== modified file 'platform/hdactl/vpn-client/mac/Library/openvpn/ca-cert.crt' (properties changed: +x to -x)
3147=== modified file 'platform/hdactl/vpn-client/mac/edit_config.sh' (properties changed: +x to -x)
3148=== modified file 'platform/hdactl/vpn/amahi/auth-dumb.pl' (properties changed: +x to -x)
3149=== modified file 'platform/hdactl/vpn/amahi/auth-pam.pl' (properties changed: +x to -x)
3150=== modified file 'platform/hdactl/vpn/openvpn-startup' (properties changed: +x to -x)
3151=== modified file 'platform/hdactl/web-installer/config.rb' (properties changed: -x to +x)
3152=== modified file 'platform/platform/Makefile'
3153--- platform/platform/Makefile 2010-08-04 20:14:11 +0000
3154+++ platform/platform/Makefile 2010-08-08 06:35:52 +0000
3155@@ -2,10 +2,6 @@
3156 ARCH=noarch
3157 RPMBASE=$(HOME)/rpmbuild
3158
3159-all: rpm
3160-
3161-copy:
3162- rsync -av release/hda-platform-*$(VERSION)*.$(ARCH).rpm $(HOME)/amahi.org-f9/html/$(ARCH)/
3163
3164 rpm: update-header dist
3165 (cd release && rpmbuild -ta hda-platform-$(VERSION).tar.gz)
3166@@ -15,7 +11,7 @@
3167 deb: update-header dist
3168 (cd release && ln -sf hda-platform-$(VERSION).tar.gz hda-platform_$(VERSION).orig.tar.gz)
3169 (cd release && tar -zxf hda-platform_$(VERSION).orig.tar.gz)
3170- (cd release/hda-platform-$(VERSION)/debian && debuild -us -uc && debuild -S -us -uc)
3171+ (debuild && debuild -S)
3172
3173 dist: clean
3174 (mkdir -p release && cd release && mkdir -p hda-platform-$(VERSION))
3175@@ -29,8 +25,7 @@
3176 update-header:
3177 sed -i -e 's/^Version:\s*[0-9.]*\s*$$/Version: $(VERSION)/' hda-platform.spec
3178
3179-install: rpm
3180- (cd release && sudo rpm -Uvh hda-platform-$(VERSION)-*.$(ARCH).rpm)
3181+donothing:
3182
3183 clean:
3184 find . -name '._*' -exec rm '{}' \;
3185
3186=== modified file 'platform/platform/debian/changelog'
3187--- platform/platform/debian/changelog 2010-03-19 22:22:18 +0000
3188+++ platform/platform/debian/changelog 2010-08-08 06:35:52 +0000
3189@@ -1,3 +1,52 @@
3190+hda-platform (5.2ubuntu8) lucid; urgency=low
3191+
3192+ * More merge changes. Includes new OS detection library!
3193+
3194+ -- Cale Cunningham <fspilotcale@gmail.com> Sun, 08 Aug 2010 01:24:24 -0500
3195+
3196+hda-platform (5.2ubuntu7) lucid; urgency=low
3197+
3198+ * Massive Merge Changes. Experimental.
3199+
3200+ -- Cale Cunningham <fspilotcale@gmail.com> Tue, 06 Jul 2010 02:28:05 -0500
3201+
3202+hda-platform (5.2ubuntu6) lucid; urgency=low
3203+
3204+ * (Hopefully) Fixed a bug in the app installer script
3205+
3206+ -- Cale Cunningham <fspilotcale@gmail.com> Wed, 09 Jun 2010 01:52:59 -0500
3207+
3208+hda-platform (5.2ubuntu5) lucid; urgency=low
3209+
3210+ * Removed a dependency that doesn't have a package (rubygem)
3211+
3212+ -- Cale Cunningham <fspilotcale@gmail.com> Fri, 04 Jun 2010 23:25:46 -0500
3213+
3214+hda-platform (5.2ubuntu4) lucid; urgency=low
3215+
3216+ * Fixed a typo
3217+
3218+ -- Cale Cunningham <fspilotcale@gmail.com> Wed, 02 Jun 2010 09:29:15 -0500
3219+
3220+hda-platform (5.2ubuntu3) lucid; urgency=low
3221+
3222+ * More package control fixes
3223+
3224+ -- Cale Cunningham <fspilotcale@gmail.com> Wed, 02 Jun 2010 09:15:39 -0500
3225+
3226+hda-platform (5.2ubuntu2) lucid; urgency=low
3227+
3228+ * Fixed package control script for build
3229+
3230+ -- Cale Cunningham <fspilotcale@gmail.com> Wed, 02 Jun 2010 09:00:05 -0500
3231+
3232+hda-platform (5.2ubuntu1) lucid; urgency=low
3233+
3234+ * Several updates to make most of the platform run smoothly on Ubuntu
3235+ * Addresses several issues with apache complaining about logs
3236+
3237+ -- Cale Cunningham <fspilotcale@gmail.com> Tue, 01 Jun 2010 21:38:55 -0500
3238+
3239 hda-platform (5.2) karmic; urgency=low
3240
3241 * Updated to revision 5.2
3242
3243=== modified file 'platform/platform/debian/control'
3244--- platform/platform/debian/control 2010-03-22 08:06:41 +0000
3245+++ platform/platform/debian/control 2010-08-08 06:35:52 +0000
3246@@ -3,13 +3,13 @@
3247 Priority: extra
3248 Maintainer: Amahi Developers <amahi-devel-request@lists.sourceforge.net>
3249 XSBC-Original-Maintainer: Praveen Kumar <praveen@kumar.in>
3250-Build-Depends: debhelper (>= 7)
3251+Build-Depends: debhelper (>= 7), rsync, devscripts
3252 Standards-Version: 3.8.0
3253 Homepage: http://www.amahi.org/
3254
3255 Package: hda-platform
3256 Architecture: all
3257-Depends: hdactl, apache2, libapache2-mod-fcgid, ruby1.8, rake, libopenssl-ruby1.8, libldap-ruby1.8, libmysql-ruby1.8, libfcgi-ruby1.8,hdactl,libyaml-ruby,libzlib-ruby,ruby-dev,rubygems,libactivesupport-ruby,libgruff-ruby,libgd-ruby, rails, patch, hddtemp
3258+Depends: hdactl, apache2, libapache2-mod-fcgid, ruby1.8, rake, libopenssl-ruby1.8, libldap-ruby1.8, libmysql-ruby1.8, libfcgi-ruby1.8,hdactl,libyaml-ruby,libzlib-ruby,ruby-dev,rubygems,libgruff-ruby,libgd-ruby, rails, patch, hddtemp
3259 Description: Amahi Home Digital Assistant web platform
3260 The Amahi Home Server is more than what you'd expect from a GNU/Linux
3261 home server. We call it "Home Digital Assistant" or HDA. The Amahi
3262
3263=== added file 'platform/platform/debian/dirs'
3264--- platform/platform/debian/dirs 1970-01-01 00:00:00 +0000
3265+++ platform/platform/debian/dirs 2010-08-08 06:35:52 +0000
3266@@ -0,0 +1,14 @@
3267+var/hda/platform/logs
3268+etc/apache2/config.d
3269+var/hda/web-apps
3270+var/hda/domain-settings/netlogon
3271+var/hda/domain-settings/profiles
3272+var/lib/samba/drivers
3273+var/hda/platform
3274+usr/share/fonts/default/TrueType
3275+usr/share/hda-platform
3276+
3277+
3278+
3279+
3280+
3281
3282=== removed file 'platform/platform/debian/hda-platform.dirs'
3283--- platform/platform/debian/hda-platform.dirs 2010-03-24 08:29:44 +0000
3284+++ platform/platform/debian/hda-platform.dirs 1970-01-01 00:00:00 +0000
3285@@ -1,14 +0,0 @@
3286-var/hda/platform/logs
3287-etc/apache2/config.d
3288-var/hda/web-apps
3289-var/hda/domain-settings/netlogon
3290-var/hda/domain-settings/profiles
3291-var/lib/samba/drivers
3292-var/hda/platform
3293-usr/share/fonts/default/TrueType
3294-usr/share/hda-platform
3295-
3296-
3297-
3298-
3299-
3300
3301=== removed file 'platform/platform/debian/hda-platform.install'
3302--- platform/platform/debian/hda-platform.install 2010-03-24 08:29:44 +0000
3303+++ platform/platform/debian/hda-platform.install 1970-01-01 00:00:00 +0000
3304@@ -1,18 +0,0 @@
3305-html var/hda/platform
3306-hda-gems-install usr/bin
3307-hda-diskmount usr/bin
3308-pdc/logon.bat var/hda/domain-settings/netlogon
3309-fonts/* usr/share/fonts/TrueType
3310-webapps usr/share/hda-platform
3311-hda-usermap usr/share/hda-platform
3312-
3313-#Files to be created in the usr/bin directory
3314-hda-refresh-shares usr/bin
3315-hda-update-webapps usr/bin
3316-hda-create-db-and-user usr/bin
3317-amahi-download usr/bin
3318-
3319-
3320-
3321-
3322-
3323
3324=== removed file 'platform/platform/debian/hda-platform.postinst'
3325--- platform/platform/debian/hda-platform.postinst 2010-03-24 08:29:44 +0000
3326+++ platform/platform/debian/hda-platform.postinst 1970-01-01 00:00:00 +0000
3327@@ -1,44 +0,0 @@
3328-#!/bin/sh
3329-# -*- shell-script -*-
3330-# postinst script for hda-platform
3331-#
3332-# see: dh_installdeb(1)
3333-
3334-set -e
3335-
3336-# summary of how this script can be called:
3337-# * <postinst> `configure' <most-recently-configured-version>
3338-# * <old-postinst> `abort-upgrade' <new version>
3339-# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
3340-# <new-version>
3341-# * <postinst> `abort-remove'
3342-# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
3343-# <failed-install-package> <version> `removing'
3344-# <conflicting-package> <version>
3345-# for details, see http://www.debian.org/doc/debian-policy/ or
3346-# the debian-policy package
3347-
3348-
3349-case "$1" in
3350- configure)
3351- echo "Deploying HDA platform"
3352-
3353- touch /var/hda/platform/html/log/production.log
3354- touch /var/hda/platform/html/log/development.log
3355- ;;
3356-
3357- abort-upgrade|abort-remove|abort-deconfigure)
3358- ;;
3359-
3360- *)
3361- echo "postinst called with unknown argument \`$1'" >&2
3362- exit 1
3363- ;;
3364-esac
3365-
3366-# dh_installdeb will replace this with shell code automatically
3367-# generated by other debhelper scripts.
3368-
3369-#DEBHELPER#
3370-
3371-exit 0
3372
3373=== added file 'platform/platform/debian/install'
3374--- platform/platform/debian/install 1970-01-01 00:00:00 +0000
3375+++ platform/platform/debian/install 2010-08-08 06:35:52 +0000
3376@@ -0,0 +1,19 @@
3377+html var/hda/platform
3378+hda-gems-install usr/bin
3379+hda-diskmount usr/bin
3380+pdc/logon.bat var/hda/domain-settings/netlogon
3381+fonts/* usr/share/fonts/TrueType
3382+webapps usr/share/hda-platform
3383+hda-usermap usr/share/hda-platform
3384+
3385+#Files to be created in the usr/bin directory
3386+hda-refresh-shares usr/bin
3387+hda-update-webapps usr/bin
3388+hda-create-db-and-user usr/bin
3389+amahi-download usr/bin
3390+hda-create-server.debian usr/bin
3391+
3392+
3393+
3394+
3395+
3396
3397=== added file 'platform/platform/debian/postinst'
3398--- platform/platform/debian/postinst 1970-01-01 00:00:00 +0000
3399+++ platform/platform/debian/postinst 2010-08-08 06:35:52 +0000
3400@@ -0,0 +1,46 @@
3401+#!/bin/sh
3402+# -*- shell-script -*-
3403+# postinst script for hda-platform
3404+#
3405+# see: dh_installdeb(1)
3406+
3407+set -e
3408+
3409+# summary of how this script can be called:
3410+# * <postinst> `configure' <most-recently-configured-version>
3411+# * <old-postinst> `abort-upgrade' <new version>
3412+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
3413+# <new-version>
3414+# * <postinst> `abort-remove'
3415+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
3416+# <failed-install-package> <version> `removing'
3417+# <conflicting-package> <version>
3418+# for details, see http://www.debian.org/doc/debian-policy/ or
3419+# the debian-policy package
3420+
3421+
3422+case "$1" in
3423+ configure)
3424+ echo "Deploying HDA platform"
3425+
3426+ mv /usr/bin/hda-update-webapps.debian /usr/bin/hda-update-webapps
3427+ mv /usr/bin/hda-create-server.debian /usr/bin/hda-create-server
3428+ touch /var/hda/platform/html/log/production.log
3429+ touch /var/hda/platform/html/log/development.log
3430+ ;;
3431+
3432+ abort-upgrade|abort-remove|abort-deconfigure)
3433+ ;;
3434+
3435+ *)
3436+ echo "postinst called with unknown argument \`$1'" >&2
3437+ exit 1
3438+ ;;
3439+esac
3440+
3441+# dh_installdeb will replace this with shell code automatically
3442+# generated by other debhelper scripts.
3443+
3444+#DEBHELPER#
3445+
3446+exit 0
3447
3448=== modified file 'platform/platform/debian/rules'
3449--- platform/platform/debian/rules 2010-03-22 08:06:41 +0000
3450+++ platform/platform/debian/rules 2010-08-08 06:35:52 +0000
3451@@ -5,3 +5,6 @@
3452 override_dh_auto_install:
3453 touch $(CURDIR)/debian/hda-platform/var/hda/web-apps/htpasswd
3454 dh_auto_install
3455+
3456+override_dh_auto_build:
3457+ $(MAKE) donothing
3458
3459=== added file 'platform/platform/hda-create-server.debian'
3460--- platform/platform/hda-create-server.debian 1970-01-01 00:00:00 +0000
3461+++ platform/platform/hda-create-server.debian 2010-08-08 06:35:52 +0000
3462@@ -0,0 +1,163 @@
3463+#!/usr/bin/env ruby
3464+#
3465+# Amahi Home Server
3466+# Copyright (C) 2007-2009 Amahi Team
3467+#
3468+# This program is free software; you can redistribute it and/or
3469+# modify it under the terms of the GNU General Public License v3
3470+# (29 June 2007), as published in the COPYING file.
3471+#
3472+# This program is distributed in the hope that it will be useful,
3473+# but WITHOUT ANY WARRANTY; without even the implied warranty of
3474+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3475+# file COPYING for more details.
3476+#
3477+# You should have received a copy of the GNU General Public
3478+# License along with this program; if not, write to the Amahi
3479+# team at http://www.amahi.org/ under "Contact Us."
3480+
3481+require 'optparse'
3482+require 'pp'
3483+
3484+SCRIPT_NAME = File.basename($0)
3485+
3486+def initscript_file(name, visible_name, user = "www-data")
3487+ file = ["#! /bin/sh",
3488+ "#",
3489+ "### BEGIN INIT INFO",
3490+ "# Provides: #{name}",
3491+ "# Default-Start: 2 3 4 5",
3492+ "# Default-Stop: 1",
3493+ "# Short-Description: #{visible_name}",
3494+ "# Required-Start: $syslog $time $local_fs $remote_fs $network $named",
3495+ "# Required-Stop:",
3496+ "# Description: #{name} is one of the services on the Amahi platform.",
3497+ "",
3498+ "### END INIT INFO",
3499+ "",
3500+ "# PATH should only include /usr/* if it runs after the mountnfs.sh script",
3501+ "PATH=/sbin:/usr/sbin:/bin:/usr/bin",
3502+ "DESC=\"#{visible_name}\"",
3503+ "NAME=#{name}",
3504+ "DAEMON=/usr/bin/#{name}",
3505+ "BASENAME=#{name}",
3506+ "DAEMON_ARGS=",
3507+ "PIDFILE=/var/run/$NAME.pid",
3508+ "SCRIPTNAME=/etc/init.d/$NAME",
3509+ "# Exit if the package is not installed",
3510+ "[ -x "$DAEMON" ] || exit 5",
3511+ "",
3512+ "# Load the VERBOSE setting and other rcS variables",
3513+ ". /lib/init/vars.sh",
3514+ "",
3515+ "# Define LSB log_* functions.",
3516+ "# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.",
3517+ ". /lib/lsb/init-functions",
3518+ "",
3519+ "# Function that starts the daemon/service",
3520+ "",
3521+ "do_start()",
3522+ "{",
3523+ " echo \"Starting $DESC\";",
3524+ " start-stop-daemon --start --oknodo --background --quiet --make-pidfile --pidfile $PIDFILE --exec $DAEMON -- \ ",
3525+ " $DAEMON_ARGS || return 1",
3526+ "}",
3527+ "",
3528+ "# Function that stops the daemon/service",
3529+ "",
3530+ "do_stop()",
3531+ "{",
3532+ " start-stop-daemon --stop --oknodo --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $BASENAME",
3533+ " RETVAL=\"$?\"",
3534+ "",
3535+ " rm -f $PIDFILE",
3536+ "",
3537+ " return $RETVAL",
3538+ " echo \"Stopped $DESC\";",
3539+ " return \"$RETVAL\"",
3540+ "}",
3541+ "",
3542+ "# Function that sends a SIGHUP to the daemon/service",
3543+ "",
3544+ "do_reload() {",
3545+ " start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME",
3546+ " return 0",
3547+ "}",
3548+ "",
3549+ "case "$1" in",
3550+ " start)",
3551+ " [ \"$VERBOSE\" != no ] && log_daemon_msg \"Starting $DESC\" \"$NAME\"",
3552+ " do_start",
3553+ " log_end_msg $?",
3554+ " ;;",
3555+ " stop)",
3556+ " [ \"$VERBOSE\" != no ] && log_daemon_msg \"Stopping $DESC\" \"$NAME\"",
3557+ " do_stop",
3558+ " log_end_msg $?",
3559+ " ;;",
3560+ " restart|force-reload)",
3561+ " log_daemon_msg "Restarting $DESC" "$NAME"",
3562+ " do_stop",
3563+ " case \"$?\" in",
3564+ " 0)",
3565+ " do_start",
3566+ " log_end_msg \"$?\"",
3567+ " ;;",
3568+ " *)",
3569+ " # Failed to stop",
3570+ " log_end_msg 1",
3571+ " ;;",
3572+ " esac",
3573+ " ;;",
3574+ " *)",
3575+ " echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2",
3576+ " exit 3",
3577+ " ;;",
3578+ "esac" ]
3579+ file.join "\n"
3580+end
3581+
3582+class OptParser
3583+
3584+ def self.parse(args)
3585+ options = { }
3586+ options[:visible_name] = nil
3587+ options[:service_name] = nil
3588+
3589+ opts = OptionParser.new do |opts|
3590+ opts.banner = "Usage: #{SCRIPT_NAME} [options] name"
3591+
3592+ opts.separator ""
3593+
3594+ opts.on("-n", "--name ServerName", "Name of the server is ServerName.") do |lib|
3595+ options[:visible_name] = lib
3596+ options[:service_name] ||= lib.downcase
3597+ end
3598+
3599+ opts.on("-s", "--service servicename", "Name of the service is 'servicename'.") do |lib|
3600+ options[:service_name] = lib
3601+ end
3602+
3603+ opts.separator ""
3604+
3605+ opts.on("-h", "--help",
3606+ "Show this help message.") { $stderr.puts opts; exit }
3607+
3608+ end
3609+ opts.parse!(args)
3610+ options
3611+ end
3612+end
3613+
3614+options = OptParser.parse(ARGV)
3615+
3616+pp options
3617+
3618+puts initscript_file("adito", "OpenVPN ALS")
3619+
3620+if options[:visible_name].nil?
3621+ $stderr.puts "error: cannot parse arguments. please run '#{SCRIPT_NAME} -h' for help."
3622+ exit 1
3623+end
3624+
3625+exit
3626
3627=== modified file 'platform/platform/hda-diskmount' (properties changed: +x to -x)
3628=== modified file 'platform/platform/hda-gems-install' (properties changed: +x to -x)
3629=== added file 'platform/platform/hda-update-webapps.debian'
3630--- platform/platform/hda-update-webapps.debian 1970-01-01 00:00:00 +0000
3631+++ platform/platform/hda-update-webapps.debian 2010-08-08 06:35:52 +0000
3632@@ -0,0 +1,33 @@
3633+#!/usr/bin/perl
3634+
3635+# update webapps all in one shot
3636+
3637+sub main {
3638+ chdir "/var/hda/web-apps";
3639+ my @files = glob("*");
3640+ &command("mkdir -p amahi_tmp_name");
3641+ foreach $i (@files) {
3642+ next unless -d "$i";
3643+ print "processing dir: $i\n";
3644+ next if -e "$i/html";
3645+ print "upgrading $i\n";
3646+ &command("mkdir -p amahi_tmp_name/$i");
3647+ &command("mv $i amahi_tmp_name/$i/html");
3648+ &command("mkdir amahi_tmp_name/$i/logs");
3649+ &command("chown www-data:users amahi_tmp_name/$i amahi_tmp_name/$i/logs");
3650+ &command("mv amahi_tmp_name/$i .");
3651+ }
3652+ &command("rmdir amahi_tmp_name");
3653+
3654+ chdir "/var/hda/platform/html";
3655+ &command("/var/hda/platform/html/script/runner 'Webapp.find(:all).each { |w| w.save! }'")
3656+}
3657+
3658+sub command {
3659+ my $cmd = shift;
3660+
3661+ print "\t$cmd\n";
3662+ system $cmd;
3663+}
3664+
3665+&main();
3666
3667=== modified file 'platform/platform/hda-usermap' (properties changed: +x to -x)
3668=== modified file 'platform/platform/hda-usermap.rb' (properties changed: +x to -x)
3669=== modified file 'platform/platform/html/app/models/user.rb'
3670--- platform/platform/html/app/models/user.rb 2010-03-30 10:07:17 +0000
3671+++ platform/platform/html/app/models/user.rb 2010-08-08 06:35:52 +0000
3672@@ -95,7 +95,8 @@
3673
3674 # add to the group called "users" so that it's like the rest
3675 def add_to_users_group
3676- c = Command.new("usermod -g users -G users \"#{self.login}\"")
3677+ c = Command.new("usermod -a -G users \"#{self.login}\"")
3678+ c = Command.new("usermod -a -G admin \"#{self.login}\"")
3679 c.execute
3680 end
3681
3682@@ -133,6 +134,7 @@
3683 pwd_option = password_option()
3684 # FIXME: use a different (programmable) group
3685 c = Command.new "useradd -g users -c \"#{self.name}\" #{pwd_option} \"#{self.login}\""
3686+ c = Command.new "usermod -a -G admin \"#{self.name}\" #{pwd_option} \"#{self.login}\""
3687 # FIXME - we should use add_or_passwd_change_samba_user above! DRY
3688 unless self.password.nil? && self.password.blank?
3689 p = self.password
3690
3691=== modified file 'platform/platform/html/app/views/front/_app.html.erb' (properties changed: +x to -x)
3692=== modified file 'platform/platform/html/app/views/front/_one.html.erb' (properties changed: +x to -x)
3693=== modified file 'platform/platform/html/app/views/front/index.html.erb' (properties changed: +x to -x)
3694=== modified file 'platform/platform/html/app/views/layouts/amahi.html.erb' (properties changed: +x to -x)
3695=== modified file 'platform/platform/html/app/views/layouts/login.html.erb' (properties changed: +x to -x)
3696=== modified file 'platform/platform/html/app/views/search/hda.rhtml' (properties changed: +x to -x)
3697=== modified file 'platform/platform/html/app/views/search/index.rhtml' (properties changed: +x to -x)
3698=== modified file 'platform/platform/html/app/views/setup/index.html.erb' (properties changed: +x to -x)
3699=== modified file 'platform/platform/html/db/migrate/20090711072328_add_shares_debug.rb'
3700--- platform/platform/html/db/migrate/20090711072328_add_shares_debug.rb 2010-05-25 00:52:27 +0000
3701+++ platform/platform/html/db/migrate/20090711072328_add_shares_debug.rb 2010-08-08 06:35:52 +0000
3702@@ -5,7 +5,7 @@
3703 Setting.set_kind('shares', 'pdc', 0)
3704 Setting.set_kind('shares', 'win98', 0)
3705 # NOTE: the domain may not be set yet in fresh installs!
3706- d = Setting.general.get('domain') || 'WORKGROUP'
3707+ d = Setting.general.get('domain') || 'home.com'
3708 Setting.set_kind('shares', 'workgroup', Share.default_samba_domain(d))
3709 end
3710
3711
3712=== added file 'platform/platform/html/lib/os-detect.rb'
3713--- platform/platform/html/lib/os-detect.rb 1970-01-01 00:00:00 +0000
3714+++ platform/platform/html/lib/os-detect.rb 2010-08-08 06:35:52 +0000
3715@@ -0,0 +1,31 @@
3716+# Amahi Home Server
3717+# Copyright (C) 2007-2009 Amahi Team
3718+#
3719+# This program is free software; you can redistribute it and/or
3720+# modify it under the terms of the GNU General Public License v3
3721+# (29 June 2007), as published in the COPYING file.
3722+#
3723+# This program is distributed in the hope that it will be useful,
3724+# but WITHOUT ANY WARRANTY; without even the implied warranty of
3725+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3726+# file COPYING for more details.
3727+#
3728+# You should have received a copy of the GNU General Public
3729+# License along with this program; if not, write to the Amahi
3730+# team at http://www.amahi.org/ under "Contact Us."
3731+
3732+Class OSDetect
3733+ def self.detect
3734+ distro = "Unknown"
3735+ fhos = File.open("/etc/issue", "r")
3736+ os = fhos.readline
3737+ if os["Fedora"]
3738+ distro = "Fedora"
3739+ elsif os["Ubuntu"]
3740+ distro = "Ubuntu"
3741+ end
3742+ fhos.close
3743+ distro
3744+ end
3745+end
3746+
3747
3748=== modified file 'platform/platform/html/log/production.log' (properties changed: -x to +x)
3749=== modified file 'platform/platform/html/script/about' (properties changed: +x to -x)
3750=== modified file 'platform/platform/html/script/console' (properties changed: +x to -x)
3751=== modified file 'platform/platform/html/script/db-backup' (properties changed: +x to -x)
3752=== modified file 'platform/platform/html/script/db-restore' (properties changed: +x to -x)
3753=== modified file 'platform/platform/html/script/dbconsole' (properties changed: +x to -x)
3754=== modified file 'platform/platform/html/script/destroy' (properties changed: +x to -x)
3755=== modified file 'platform/platform/html/script/generate' (properties changed: +x to -x)
3756=== modified file 'platform/platform/html/script/install-app' (properties changed: +x to -x)
3757--- platform/platform/html/script/install-app 2010-06-16 20:48:21 +0000
3758+++ platform/platform/html/script/install-app 2010-08-08 06:35:52 +0000
3759@@ -16,11 +16,13 @@
3760 # team at http://www.amahi.org/ under "Contact Us."
3761
3762 require File.dirname(__FILE__) + '/../config/boot'
3763+require File.dirname(__FILE__) + '/../lib/os-detect.rb'
3764 #require 'commands/runner'
3765 require 'optparse'
3766
3767 # switch to apache:users first
3768-uid = Etc.getpwnam("apache").uid
3769+uid = Etc.getpwnam("apache").uid if OSDetect.detect == "Fedora"
3770+uid = Etc.getpwnam("www-data").uid if OSDetect.detect == "Ubuntu"
3771 gid = Etc.getgrnam("users").gid
3772 Process.gid = gid
3773 Process.egid = gid
3774
3775=== modified file 'platform/platform/html/script/install-servers' (properties changed: +x to -x)
3776=== modified file 'platform/platform/html/script/performance/benchmarker' (properties changed: +x to -x)
3777=== modified file 'platform/platform/html/script/performance/profiler' (properties changed: +x to -x)
3778=== modified file 'platform/platform/html/script/plugin' (properties changed: +x to -x)
3779=== modified file 'platform/platform/html/script/reset-user-password' (properties changed: +x to -x)
3780=== modified file 'platform/platform/html/script/runner' (properties changed: +x to -x)
3781=== modified file 'platform/platform/html/tmp/cache/.gitignore' (properties changed: -x to +x)
3782=== modified file 'platform/platform/html/tmp/pids/.gitignore' (properties changed: -x to +x)
3783=== modified file 'platform/platform/html/tmp/sessions/.gitignore' (properties changed: -x to +x)
3784=== modified file 'platform/platform/html/tmp/sockets/.gitignore' (properties changed: -x to +x)

Subscribers

People subscribed via source and target branches