LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-26-2015, 08:28 PM   #1
Nh3xus
Member
 
Registered: Jan 2013
Location: France
Distribution: Slackware 14.1 32 bits
Posts: 211

Rep: Reputation: 57
Lightbulb [PHP][Tiny Tiny RSS] Run a php updater daemon


Hi guys,

I'm trying to refresh my apache knowledge by putting together small services on my LAN.

I'm wondering what are the best practices when it comes to run a php script as a deamon with the apache account on Slackware 14.1

By security, Slackware ships the apache account with a fake shell
Code:
/bin/false
which can't run anything at all (of course)

Basically, here's the command I need to run as a daemon :
Code:
php ./update.php daemon
It's meant to update RSS feeds retrived by Tiny Tiny RSS.

The folder is owned by apache:apache so running the script with any other account might result in permissions conflicts.

I've though about giving the apache user a restricted shell and then, run said command in a screen instance.

Any thoughts on this ?

Tiny Tiny RSS related documentation

Cheers.

Last edited by Nh3xus; 10-26-2015 at 08:30 PM. Reason: adding documentation source
 
Old 10-26-2015, 09:23 PM   #2
Diantre
Member
 
Registered: Jun 2011
Distribution: Slackware
Posts: 515

Rep: Reputation: 234Reputation: 234Reputation: 234
Quote:
Originally Posted by Nh3xus View Post
The folder is owned by apache:apache so running the script with any other account might result in permissions conflicts.

I've though about giving the apache user a restricted shell and then, run said command in a screen instance.

Any thoughts on this ?
I would change the folder ownership to apache:users, change the folder permissions to 775, and run the script under my username, which defaults to me:users. This way the script would be able to write there.

I think that's safer than giving shell access to the apache user.
 
Old 10-27-2015, 07:35 AM   #3
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
You can invoke a command even with it being /bin/false...

Code:
su apache -s /bin/sh -c "php /full/location/to/update.php daemon"
This is how I run sickbeard/sickrage on my machine whhen the sickbeard user is assigned /bin/false
 
1 members found this post helpful.
Old 10-27-2015, 09:29 AM   #4
Nh3xus
Member
 
Registered: Jan 2013
Location: France
Distribution: Slackware 14.1 32 bits
Posts: 211

Original Poster
Rep: Reputation: 57
Thanks guys

bassmadrigal's advice worked like a charm.

The daemon runs in a screen instance now.
 
  


Reply

Tags
apache php daemon screen



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Tiny Tiny RSS - Best google reader alternative LXer Syndicated Linux News 0 09-02-2012 01:43 AM
LXer: Tiny Core Linux 4.2 Introduces Tiny Core Plus LXer Syndicated Linux News 0 12-27-2011 09:30 AM
LXer: Tiny Core- A 10 MB Tiny Linux Desktop LXer Syndicated Linux News 0 02-28-2010 07:00 PM
LXer: Tiny PC, relatively tiny price (but the exchange rate's killing us) LXer Syndicated Linux News 0 01-29-2008 02:11 AM
LXer: Tiny Tiny RSS: A very very useful RSS reader LXer Syndicated Linux News 0 05-16-2007 02:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration