Senin, 12 Januari 2015

Bristol Digest, Vol 585, Issue 3

Send Bristol mailing list submissions to
bristol@mailman.lug.org.uk

To subscribe or unsubscribe via the World Wide Web, visit
https://mailman.lug.org.uk/mailman/listinfo/bristol
or, via email, send a message with subject or body 'help' to
bristol-request@mailman.lug.org.uk

You can reach the person managing the list at
bristol-owner@mailman.lug.org.uk

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Bristol digest..."


Today's Topics:

1. Re: How to download overnight? (Chris)
2. Re: How to download overnight? (Shane McEwan)
3. Bye bye upstart & systemd (Martin Habets)
4. Re: Which distro (Syed Rahman)
5. Re: How to download overnight? (Peter Hemmings)


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

Message: 1
Date: Mon, 12 Jan 2015 12:17:35 +0000
From: Chris <cshorler@googlemail.com>
To: Bristol and Bath Linux User Group <bristol@mailman.lug.org.uk>
Subject: Re: [bristol] How to download overnight?
Message-ID: <259CC096-62A5-491B-B59F-32C1FD08A63A@googlemail.com>
Content-Type: text/plain; charset=UTF-8

On 12 January 2015 11:46:34 GMT+00:00, Dave Stewart <bblug@iridium.org.uk> wrote:
>On Sun, 11 Jan 2015, Marc Gray wrote:
>
>> ?Seriously?
>
>I'd even be tempted to wrap wget in a loop and invoke it as wget -c
>$URL,
>just in case there's an interruption half way through.
>
>> OK, but I can't have this.
>>
>> sudo bash -c 'su $SUDO_USER -c wget http://url/file.iso; shutdown -h
>now'
>
>I'm pretty sure that won't work as written. Spotting the mistake is
>left
>as an exercise for the reader ;-)

My guess is the computer would shutdown immediately because you're missing &&

Though I have no computer at lunch...





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

Message: 2
Date: Mon, 12 Jan 2015 12:33:43 +0000
From: Shane McEwan <shane@mcewan.id.au>
To: bristol@mailman.lug.org.uk
Subject: Re: [bristol] How to download overnight?
Message-ID: <54B3BF27.2040300@mcewan.id.au>
Content-Type: text/plain; charset=utf-8

On 12/01/15 11:46, Dave Stewart wrote:
> On Sun, 11 Jan 2015, Marc Gray wrote:
>> OK, but I can't have this.
>>
>> sudo bash -c 'su $SUDO_USER -c wget http://url/file.iso; shutdown -h now'
>
> I'm pretty sure that won't work as written. Spotting the mistake is
> left as an exercise for the reader ;-)

The "correct" way to do it is to add:

yourusername ALL=NOPASSWD: /sbin/halt

to the /etc/sudoers file (sudo visudo) so you can halt the machine
without being prompted for a password.

Also, you might not want to halt the machine if wget has an error so use
'&&' rather than ';' between commands:

wget http://url/file.iso && sudo /sbin/halt -p

Alternatively, there are applications like 'kshutdown' and 'sentinella'
that will watch an already running process and perform an action (which
could be a shutdown) when the process finishes.

Shane.



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

Message: 3
Date: Mon, 12 Jan 2015 15:48:27 +0000
From: Martin Habets <errandir_news@mph.eclipse.co.uk>
To: bristol@mailman.lug.org.uk
Subject: [bristol] Bye bye upstart & systemd
Message-ID: <20150112154827.GA20524@mph.eclipse.co.uk>
Content-Type: text/plain; charset="us-ascii"

Hi all,

I've not been a fan of upstart and systemd ever since they came around.
But I figured after a while they would come good and actually come good on
the promisses they make. The fact that my computer has been booting slower
ever since has been a minor issue, since I do not need to reboot very often.
A bigger hassle have been all the extra processes running.

But over Christmas the system failed to boot at all, and after investigating
and trying to fix things for a day or two I decided to get rid of the new init
scheme that was causing my headaches.
Had I been running Debian (which most of my machines do) I could have just
reinstalled sysv-init, but even on Ubuntu it turned out to be a lot simpler
than I expected. The steps I took was:

1. Fix the startup scripts in /etc/rc2.d and /etc/rcS.d. To replace the stuff
from /etc/init I added 1 startup script as /etc/rcS.d/S01mountvirtfs
(attached).
As part of the cull almost all of systemd has been dropped, and only udev
is left running.
I tested these by booting the kernel with 'init=/bin/bash' and then run
the scripts manually.

2. Download the SysV init source code from
http://download.savannah.gnu.org/releases/sysvinit/insserv-latest.tar.bz2
Build it. Since I did not want to loose the old upstart executables (mainly
/sbin/init) I edited the Makefile to create backup copies when installing
the SysV executables by adding the last parameter:
INSTALL_EXEC = install -o $(BIN_OWNER) -g $(BIN_GROUP) -m 755 --backup=numbered
INSTALL_DATA = install -o $(BIN_OWNER) -g $(BIN_GROUP) -m 644 --backup=numbered

3. Reboot, adjust & enjoy.

4. Disable updates to the upstart package:
apt-mark hold upstart

I do not expect any problems when updating my system, but only time will tell.
All updates to /etc/init can still be applied, but they won't have any effect
off course.
All in all my system boots a lot quicker again, and once up fewer processes
are running. The stuff above only took me a few hours, much less than I already
wasted trying to fix the problem. So it's been a happy new year to me.

Happy New year to all you as well,
Martin
-------------- next part --------------
#!/bin/sh
########################################################################
# Begin mountvirtfs
#
# Description : Mount proc, sysfs, swap, run and shm.
#
########################################################################

### BEGIN INIT INFO
# Provides: mountvirtfs
# Required-Start:
# Should-Start:
# Required-Stop:
# Should-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: Mounts /sys and /proc virtual (kernel) filesystems.
# Mounts /run (tmpfs) and /dev (devtmpfs).
# Description: Mounts /sys and /proc virtual (kernel) filesystems.
# Mounts /run (tmpfs) and /dev (devtmpfs).
# X-LFS-Provided-By: LFS
### END INIT INFO

case "${1}" in
start)
mount -o remount /
#mount -a
mount /proc
mount /sys
swapon -a

mount /run
mkdir -p /run/lock /run/shm
chmod 1777 /run/lock /run/shm
ln -sfn /run/shm /dev/shm

# ssh needs to allocate virtual ttys
mkdir -p /dev/pts
mount /dev/pts

test -f /etc/hostname && hostname $(< /etc/hostname)

ifconfig lo up
;;
*)
echo "Usage: ${0} {start}"
exit 1
;;
esac


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

Message: 4
Date: Mon, 12 Jan 2015 16:48:49 +0000
From: Syed Rahman <sidsbr@gmail.com>
To: Bristol and Bath Linux User Group <bristol@mailman.lug.org.uk>
Subject: Re: [bristol] Which distro
Message-ID:
<CAEjaE9VaN9Fx_KZkX=1S3mRxp4JgvP_=GhetRWbwbVRZqmxrBw@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi Martin,

Just to chip in. Centos is to be officially supported (funded) but RH so no
need to move off it but 5.2 is very long in the tooth so could solve some
of your problem there.

In regards to rpms, we have has similar src install issues at work and fpm
is a very quick way to convert these into rpms so at least it is standard.
Then you can replace them with proper rpms at a later date. Help you get
control of the problem :D

Cheers
Syed

On 8 January 2015 at 12:03, Amias Channer <me@amias.net> wrote:

> Hello Martin,
>
> I definitely agree with the sentiment that packaging is important , if you
> don't do it you end up doing work that prevents you doing it in future and
> so will everyone else and then bad things happen.
>
> Package it and test it because that is the right way to do it.
>
> RPM is stable and works , i think you will probably want to find a
> tutorial for creating RPMs that focuses on the type of packages you want to
> make e.g. applications need a different approach from services and
> everything has different requirements for how updates work in relation to
> configuration files.
>
> Another option to consider is docker which allows you to create something
> between a chroot and virtual machine , it has the advantage of being cross
> platform so you should then be reasonably distro agnostic. It only works
> properly on 64bit machines for me but that might be an ubuntu/debian thing.
>
> Cheers
> Amias
>
> On 8 January 2015 at 00:08, D J Stewart <bblug@iridium.org.uk> wrote:
>
>> On Wed, 7 Jan 2015, nick robinson wrote:
>>
>> having worked with martin on previous projects where the custom deb
>>> packing was a complete ball ache i am more than happy to say copying some
>>> small internal development sources from one machine to another can be a
>>> hell of a lot more efficient than maintaining packaged files.
>>>
>>
>> Then your experience is different to mine. I've worked with Martin and
>> his habit of packaging everything properly made life much easier than it
>> would otherwise have been.
>>
>> By way of example, he had some servers using template toolkit and relying
>> on Apache::Template. A recentish (2009 or so) change to TT2 broke A::T. It
>> was a simple enough thing to fix[0]. Because it was packaged by Martin and
>> added to his local APT repository, upgrading all affected servers happened
>> automatically on "apt-get update && apt-get dist-upgrade". Because it was
>> packaged, any new servers needing Apache::Template automatically got the
>> right thing. At no point was there the tedious administrative overhead of
>> having to remember that Apache::Template is a special case and needs to be
>> installed using "svn co ... && perl Makefile.PL && make && make test &&
>> make install"
>>
>> Packaging allows for you to continue using the standard system tools in
>> order to manage all of the software on your system. It allows you do do
>> simple integrity checks to detect accidental corruption (eg, debsums), it
>> allows you to make sure that the absence of the package you are about to
>> uninstall won't break some other package you will still be using on your
>> system. Packaging helps you to maintain the integrity and consistency of
>> the software on your system and will save you from yourself. It is WELL
>> worth the small amount of overhead.
>>
>> [0] I sent a diff to the person who appears to maintain Apache::Template
>> for Apache2 but so far the version he distributes seems to be unfixed, so I
>> guess very few people use that module.
>>
>> --
>> Dave Stewart
>>
>>
>> _______________________________________________
>> Bristol mailing list
>> Bristol@mailman.lug.org.uk
>> https://mailman.lug.org.uk/mailman/listinfo/bristol
>>
>
>
> _______________________________________________
> Bristol mailing list
> Bristol@mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/bristol
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.lug.org.uk/mailman/private/bristol/attachments/20150112/b6fc2c2a/attachment-0001.html>

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

Message: 5
Date: Mon, 12 Jan 2015 20:43:58 +0000
From: Peter Hemmings <peter@hemmings.eclipse.co.uk>
To: Bristol and Bath Linux User Group <bristol@mailman.lug.org.uk>
Subject: Re: [bristol] How to download overnight?
Message-ID: <54B4320E.3040205@hemmings.eclipse.co.uk>
Content-Type: text/plain; charset=windows-1252; format=flowed



On 12/01/15 12:33, Shane McEwan wrote:
> On 12/01/15 11:46, Dave Stewart wrote:
>> On Sun, 11 Jan 2015, Marc Gray wrote:
>>> OK, but I can't have this.
>>>
>>> sudo bash -c 'su $SUDO_USER -c wget http://url/file.iso; shutdown -h now'
>>
>> I'm pretty sure that won't work as written. Spotting the mistake is
>> left as an exercise for the reader ;-)
>
> The "correct" way to do it is to add:
>
> yourusername ALL=NOPASSWD: /sbin/halt
>
> to the /etc/sudoers file (sudo visudo) so you can halt the machine
> without being prompted for a password.
>
> Also, you might not want to halt the machine if wget has an error so use
> '&&' rather than ';' between commands:
>
> wget http://url/file.iso && sudo /sbin/halt -p
>
> Alternatively, there are applications like 'kshutdown' and 'sentinella'
> that will watch an already running process and perform an action (which
> could be a shutdown) when the process finishes.
>
> Shane.
>
> _______________________________________________
> Bristol mailing list
> Bristol@mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/bristol
>

Thanks for the replies, I will give it a go!


Apologies for delay in replying but the replies (and my original) have
only just been delivered!

Regards
--
Peter H



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

_______________________________________________
Bristol mailing list
Bristol@mailman.lug.org.uk
https://mailman.lug.org.uk/mailman/listinfo/bristol

End of Bristol Digest, Vol 585, Issue 3
***************************************

Tidak ada komentar:

Posting Komentar