You are not logged in.

#1 2007-10-08 05:19:45

dtandersen
Member
Registered: 2007-01-30
Posts: 41

PKGBUILD for BackupPC

How's this look?  It's my first one!  It's for the BackupPC backup program.

One question I have is about the /etc/rc.d/backuppc file I created.  I create a directory for it under pkg/etc/rc.d and then copy it there.  Is that kosher?

The app itself goes under /opt/BackupPC.  The logs go under /var/logs/BackupPC.  The config is under /etc/BackupPC.  The backups go under /var/BackupPC.

Wiki page here: http://wiki.archlinux.org/index.php/BackupPC

Where do I go from here?

[edit: files removed, see pkgbuild in the aur]

Last edited by dtandersen (2007-10-17 18:22:04)

Offline

#2 2007-10-08 13:26:20

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: PKGBUILD for BackupPC

Two things you'll need to do:

1) Change the install line to

install -Dm 755 $startdir/src/backuppc $startdir/pkg/etc/rc.d/backuppc

2) Make a .install file to create the backuppc user - you'll need to decide on a UID for this user, and use it consistently.  Generally something random below 1000 should be good - but you've got to make sure it's not in use by something else.  I'm not sure where you'd find a list of "reserved" user IDs.

for example

useradd backuppc --uid 391 --home /opt/BackupPC

Also, as a note, whoever is building the package also needs this user defined, so you may need to add this line to both the .install file and the PKGBUILD (before the configure.pl line)

Offline

#3 2007-10-08 14:48:21

dtandersen
Member
Registered: 2007-01-30
Posts: 41

Re: PKGBUILD for BackupPC

I was wondering why does the uid need to be the same on all systems?

Offline

#4 2007-10-09 04:07:05

dtandersen
Member
Registered: 2007-01-30
Posts: 41

Re: PKGBUILD for BackupPC

Looks like 91 is next

useradd -u 9 -g news -d /var/spool/news news
useradd -c "SlimServer" -g users -s /bin/false slimserver && echo "done."
useradd -u 10 -g uucp -d '/' -s /bin/false uucp &>/dev/null
useradd -u 10 -g uucp -d '/' -s /bin/false uucp &>/dev/null
useradd -u 15 -g proxy -d /var/empty proxy
useradd -u 16 -g stunnel -d /var/run/stunnel -s /bin/false stunnel
useradd -u 17 -g jabber -d /var/lib/jabber -s /bin/false jabber
useradd -u 31 -g nrpe -c "Nagios NRPE" -d /dev/null -s /bin/false nrpe
useradd -u 40 -c "BIND DNS Server" -g named -d /var/named -s /bin/false named
useradd -u 42 -g privoxy -d /var/spool/privoxy -s /bin/false privoxy &>/dev/null
useradd -u 43 -g tor -d /var/lib/tor -s /bin/false tor
useradd -u 45 -g mpd -d /var/lib/mpd -s /bin/true mpd &>/dev/null
useradd -u 58 -d /var/lib/rbldns -g rbldns -s /bin/false rbldns
useradd -u 59 -d /var/lib/rbldns -g rbldnszones -s /bin/false rbldnszones
useradd -u 60 -g nobody -d /var/empty -c "djbdns log user" -s /bin/false dnslog
useradd -u 61 -g nobody -d /var/empty -c "dnscache daemon" -s /bin/false dnscache
useradd -u 62 -g nobody -d /var/empty -c "tinydns daemon" -s /bin/false tinydns
useradd -u 63 -g nobody -d /var/empty -c "axfrdns daemon" -s /bin/false axfrdns
useradd -u 64 -g clamav -c "Clam AntiVirus" -d /dev/null -s /bin/false clamav
useradd -u 65 -g bitlbee -d /var/lib/bitlbee -s /bin/false bitlbee
useradd -u 66 -g tomcat -d /opt/tomcat -s /bin/false tomcat
useradd -u 69 -g daemon -d '/' -s /bin/false fax &>/dev/null
useradd -u 69 -g daemon -d '/' -s /bin/false fax &>/dev/null
useradd -u 72 -d /var/spool/courier -g courier -s /bin/false courier &>/dev/null
useradd -u 73 -d /var/spool/postfix -g postfix -s /bin/false postfix
useradd -u 76 -d /var/run/dovecot/login -g dovecot -s /bin/false dovecot
useradd -u 79 -g exim -d /var/spool/exim -s /bin/false exim
useradd -u 79 -g exim -d /var/spool/exim -s /bin/false exim &>/dev/null
useradd -u 80 -g mailman -d /home/mailman -s /bin/false mailman &>/dev/null
useradd -u 80 -g mailman -d /home/mailman -s /bin/false mailman \
useradd -c 'System message bus' -u 81 -g dbus -d '/' -s /bin/false dbus
useradd -c 'HAL daemon' -u 82 -g hal -G optical,floppy,storage -d '/' -s /bin/false hal
useradd -u 83 -d /tmp -g nsvsd -s /bin/false nsvsd
useradd -c "Avahi daemon" -u 84 -d / -g avahi -s /bin/false avahi \
useradd -c 'User for Beagle indexing' -u 86 -g beaglidx -d '/' -s /bin/false beaglidx
useradd -u 88 -g postgres -d $PGROOT -s /bin/bash postgres
useradd -u 89 -g mysql -d $MYSQLD_ROOT -s /bin/false mysql
useradd -u 90 -g nobody \

Offline

#5 2007-10-10 13:34:36

sinecure
Member
Registered: 2007-09-22
Posts: 21
Website

Re: PKGBUILD for BackupPC

Have you decided on a userid for the backuppc user yet?  91 looks good, although there are a few above 91.

Here's the command I used to get all (for some values of 'all') of the users which are added with specific UIDs:

grep -hr useradd /var/abs/* | grep -e '-u ' | sed -e 's/^.*-u \([0-9]\+\).*$/\1/' | sort -gu | xargs

Here's the output:

9 10 15 16 17 18 22 31 40 42 43 45 58 59 60 61 62 63 64 65 66 69 72 73 76 79 80 81 82 83 84 86 88 89 90 100 106 115 130

That only covers the core/extra/community/testing/unstable PKGBUILDS.  I'm not sure how to generate the same list for the packages in unsupported.

Last edited by sinecure (2007-10-10 19:18:26)

Offline

#6 2007-10-10 14:45:44

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: PKGBUILD for BackupPC

dtandersen wrote:

I was wondering why does the uid need to be the same on all systems?

Because if any files are owned by that user (which is entirely likely) they are owned by UID, not by username. 

Example, if you chown root /path/to/myfile then /path/to/myfile's owner is now user 0.  IF another system has user 0 mapped to "jim", then when you put any root-owned files onto Jim's PC, they suddenly become jim-owned files.

Consistency in this case is a good idea.

Offline

#7 2007-10-10 18:18:11

dtandersen
Member
Registered: 2007-01-30
Posts: 41

Re: PKGBUILD for BackupPC

I got the BackupPC/Apache integration working last night.  I'll post new PKGBUILD soon!

Offline

#8 2007-10-10 19:13:35

elasticdog
Member
From: Washington, USA
Registered: 2005-05-02
Posts: 995
Website

Re: PKGBUILD for BackupPC

sinecure wrote:
grep -hr useradd /var/abs/* | grep -e '-u ' | sed -e 's/^.*-u \([0-9]\+\).*$/\1/' | sort -gu

Here's the output:

9 10 15 16 17 18 22 31 40 42 43 45 58 59 60 61 62 63 64 65 66 69 72 73 76 79 80 81 82 83 84 86 88 89 90 100 106 115 130

Nice one-liner!

Offline

#9 2007-10-10 19:18:05

sinecure
Member
Registered: 2007-09-22
Posts: 21
Website

Re: PKGBUILD for BackupPC

Thanks.  Although I just noticed a mistake - pipe the result of that command through xargs to get it all on one line, otherwise each number is on a line of its own (too many lines).  I'll edit the above to correct it.

Offline

#10 2007-10-13 20:25:48

sinecure
Member
Registered: 2007-09-22
Posts: 21
Website

Re: PKGBUILD for BackupPC

Any luck with the new PKGBUILD?  I'd like to play around with backuppc and my favorite web server, mathopd.

Offline

#11 2007-10-16 21:27:22

dtandersen
Member
Registered: 2007-01-30
Posts: 41

Re: PKGBUILD for BackupPC

Here it is

http://aur.archlinux.org/packages.php?d … hans=&SeB=

and some basic documentation

http://wiki.archlinux.org/index.php/BackupPC

Last edited by dtandersen (2007-10-16 21:34:42)

Offline

#12 2007-10-16 21:52:18

dtandersen
Member
Registered: 2007-01-30
Posts: 41

Re: PKGBUILD for BackupPC

Do you think I should require Apache in the PKGBUILD?  BackupPC is pretty useless without it.

Offline

#13 2007-10-17 13:35:02

sinecure
Member
Registered: 2007-09-22
Posts: 21
Website

Re: PKGBUILD for BackupPC

I wouldn't, only because I don't use apache.  AFAICT it's usable with any web server, but is most used with Apache.

Offline

#14 2007-10-17 17:59:27

dtandersen
Member
Registered: 2007-01-30
Posts: 41

Re: PKGBUILD for BackupPC

Perhaps it's best to split the Apache integration into another package called 'backuppc-apache'.

Offline

#15 2007-10-17 19:10:19

sinecure
Member
Registered: 2007-09-22
Posts: 21
Website

Re: PKGBUILD for BackupPC

That would probably work.  Then maybe a note in the backuppc install file telling the user where to find the apache stuff?

Offline

#16 2007-10-17 20:47:45

dtandersen
Member
Registered: 2007-01-30
Posts: 41

Re: PKGBUILD for BackupPC

I was looking at the FHS.  What's the better place for the webserver files? 

/opt/BackupPC/www (current place)
/srv/www/BackupPC
/srv/BackupPC/www
???

Last edited by dtandersen (2007-10-17 20:50:34)

Offline

#17 2007-10-17 21:31:45

sinecure
Member
Registered: 2007-09-22
Posts: 21
Website

Re: PKGBUILD for BackupPC

I would say /srv/www/BackupPC would make the most sense.  When looking into this, though, I came across the following thread:

http://bbs.archlinux.org/viewtopic.php? … 48#p250548

That makes me confused about whether the apache integration should be:
  Done for the user as part of the backuppc PKGBUILD
    or
  Done for the user as part of a backuppc-apache PKGBUILD
    or
  Not done for the user, but installed as part of the backuppc PKGBUILD

The last option would require a man page describing the integration with Apache.  I'm not sure which would be correct.  Perhaps another TU/Dev could comment?

Offline

#18 2007-10-17 22:26:34

dtandersen
Member
Registered: 2007-01-30
Posts: 41

Re: PKGBUILD for BackupPC

The way I see it the backuppc package will install the web scripts (cgi-bin and images) to the /srv/www/BackupPC directory.  This way all the web files are available so you can use whatever web server you want.

The backuppc-apache package will install the backuppc-httpd daemon into /etc/rc.d and put backuppc-httpd.conf into /etc/httpd/conf.  It will also depend on apache and mod_perl.

BackupPC is more than a web script because a) it runs as a daemon and b) it requires its own server running as the backuppc user.  The setup is more involved than setting up, say, phpMyAdmin.

Last edited by dtandersen (2007-10-17 22:35:09)

Offline

#19 2007-10-18 05:28:39

sinecure
Member
Registered: 2007-09-22
Posts: 21
Website

Re: PKGBUILD for BackupPC

Ahhh... makes sense.  This weekend I'll play with backuppc and mathopd to see if I can get a viable install.  Assuming I can, I'll be posting some instructions on the wiki.

FYI.

Offline

#20 2007-10-23 05:19:16

sinecure
Member
Registered: 2007-09-22
Posts: 21
Website

Re: PKGBUILD for BackupPC

Unfortunately didn't get a chance last weekend, and going out of town for six days tomorrow.  I'll update you when I get to test the package with mathopd.

Offline

Board footer

Powered by FluxBB