FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 02-20-2012, 06:35 PM
Steven Stern
 
Default Start script

On 02/20/2012 01:29 PM, Fedora Linux wrote:
> Hello friends
>
> I have a doubt about how to make a start script to launche services and
> do some stuff every time that fedora boots...
>
> I created a script
>
>
> /etc/rc.d/init.d/MyStartupScript rwxr-xr-x
>
> rm -fr /tmp/*
> rm -fr /tmp/.*
> mysqld_safe --user=mysql &
>
> but it simply does nothing... I have Fedora 16... how and where should I
> put my script?
>
> Thanks
>
>
>
You want to put the contents into /etc/rc.d/rc.local


But to start MySQL, let the system start it automatically by adding it
to the list of services

sudo systemctl enable mysqld.service


--
-- Steve
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 
Old 02-20-2012, 09:28 PM
Cameron Simpson
 
Default Start script

On 20Feb2012 13:29, Fedora Linux <fedoralinux@toursbymexico.com> wrote:
| I created a script
[...]
| rm -fr /tmp/*
| rm -fr /tmp/.*

Just a remark. DO NOT DO THIS!

Other program may well have stuff in /tmp active by the time your script
runs. It MUST NOT blow things away in a careless and untargeted way like
this.

/tmp /cleaning stuff must happen as the very first thing in a system (if
it happens at all). NOT as part of some random start/stop script that
may run at any time (including long after the system starts, if you shut
the service down and start it up again, a not uncommon maintenance
process).

Cheers,
--
Cameron Simpson <cs@zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

The ZZR-1100 remains the big, fast, versatile bike for the rider with a
regular pillion passenger or the desire to humiliate just about every
other road user who attempted to match its straight line acceleration. - REVS
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 
Old 02-20-2012, 09:38 PM
suvayu ali
 
Default Start script

On Mon, Feb 20, 2012 at 23:28, Cameron Simpson <cs@zip.com.au> wrote:
> /tmp /cleaning stuff must happen as the very first thing in a system (if
> it happens at all). NOT as part of some random start/stop script that
> may run at any time (including long after the system starts, if you shut
> the service down and start it up again, a not uncommon maintenance
> process).

Or use tmpwatch to do the cleaning.

--
Suvayu

Open source is the future. It sets us free.
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 
Old 02-20-2012, 09:40 PM
Alan Cox
 
Default Start script

On Tue, 21 Feb 2012 09:28:12 +1100
Cameron Simpson <cs@zip.com.au> wrote:

> On 20Feb2012 13:29, Fedora Linux <fedoralinux@toursbymexico.com> wrote:
> | I created a script
> [...]
> | rm -fr /tmp/*
> | rm -fr /tmp/.*
>
> Just a remark. DO NOT DO THIS!
>
> Other program may well have stuff in /tmp active by the time your script
> runs. It MUST NOT blow things away in a careless and untargeted way like
> this.


Also don't do it because rm -rf /tmp/.* matches /tmp/.. aka /

and you really don't want to go there...

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 
Old 02-20-2012, 11:00 PM
Dave Ihnat
 
Default Start script

On Mon, Feb 20, 2012 at 11:38:49PM +0100, suvayu ali wrote:
> Or use tmpwatch to do the cleaning.

A good suggestion. I would also point out a warning to developers--of both
compiled programs and scripts.

It's a poor program or script that creates files in /tmp or /usr/tmp and
doesn't take appropriate steps to protect itself. You should *expect*
files and/or directories to be deleted from temporary directories.

So how do you protect yourself? Set the sticky bit on files and
directories. Keep them open as long as you're going to need them (open
files and directories can't be "really" deleted.) And, of course,
be good about cleaning up after yourself when you no longer need them.

Good developers are paranoid.

Cheers,
--
Dave Ihnat
dihnat@dminet.com
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 
Old 02-21-2012, 01:10 PM
"Mikkel L. Ellertson"
 
Default Start script

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/20/2012 06:00 PM, Dave Ihnat wrote:
> On Mon, Feb 20, 2012 at 11:38:49PM +0100, suvayu ali wrote:
>> Or use tmpwatch to do the cleaning.
>
> A good suggestion. I would also point out a warning to
developers--of both
> compiled programs and scripts.
>
> It's a poor program or script that creates files in /tmp or
/usr/tmp and
> doesn't take appropriate steps to protect itself. You should *expect*
> files and/or directories to be deleted from temporary directories.
>
> So how do you protect yourself? Set the sticky bit on files and
> directories. Keep them open as long as you're going to need them (open
> files and directories can't be "really" deleted.) And, of course,
> be good about cleaning up after yourself when you no longer need them.
>
> Good developers are paranoid.
>
>
One other thing - homer the TMP variable. Not so much for system
programs, but for user programs. I have a tmp directory as part of
/etc/skel, so every user gets a tmp directory as part of their home
directory structurer. The I set TMP as part of the login script. All
my user scripts are set to use it. You do have to clean it
sometimes if programs/scripts do not clean up after themselves, but
at least you do not clobber needed temporary files.

Mikkel
- --
Do not meddle in the affairs of dragons, for thou art crunchy and
taste good with Ketchup!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAk9DpeQACgkQqbQrVW3JyMTTzQCfVo/Edo6/eCXdfDULrA9TLOk1
4zMAn2CrxYWQJFjE8O9eH04FvFUiooJY
=w87J
-----END PGP SIGNATURE-----

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 
Old 02-24-2012, 08:14 PM
James Wilkinson
 
Default Start script

Mikkel L. Ellertson wrote:
> One other thing - homer the TMP variable. Not so much for system
> programs, but for user programs. I have a tmp directory as part of
> /etc/skel, so every user gets a tmp directory as part of their home
> directory structurer. The I set TMP as part of the login script. All
> my user scripts are set to use it. You do have to clean it
> sometimes if programs/scripts do not clean up after themselves, but
> at least you do not clobber needed temporary files.

http://fedoraproject.org/wiki/Infrastructure/FedoraPeopleConfig#polyinstantiated_tempdirs
describes a way that each user gets their own /tmp, with only their
files in, which is actually their $HOME/tmp directory.

That way you don’t have to rely on programs being well-behaved.

There’s a Fedora Feature hanging around which might even get finished
someday to make this happen by default. There’s also
http://fedoraproject.org/wiki/Features/ServicesPrivateTmp , which will
be in Fedora 17, which will do this for most system services.

Hope this helps,

James.

--
E-mail: james@ | I learnt the rules of rugby. There is only one rule.
aprilcottage.co.uk | "Skip it by any means necessary".
| -- "Nix"
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
 

Thread Tools




All times are GMT. The time now is 07:04 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org