-1
#! /bin/sh


# Carry out specific functions when asked to by the system
 case "$1" in
  start)

  chmod a+rwx /var/www/html/Images/*
  echo "success"
  ;;
  stop)
  ;;
  *)
  echo "Usage: /etc/init.d/image {start|stop}"
  exit 1
  ;;
  esac

Im using run levels to run my chmod when the system is boot up but it is only run once and how can i keep allow chmod to keep running when system is boot up? Anybody can help? i'm using ubuntu 16.04.

Vasu
  • 265
  • 1
  • 10
  • 18
Alvin Wee
  • 195
  • 2
  • 4
  • 16

2 Answers2

2

Don't use chmod in this way. In the long run it creates lots of pain and will turn your box into a worm pit. What you want to do there is a huge security no-go.

If you want users to be able to write to a certain location, use proper filesystem access rights. Create a new group for whoever shall be able to write to that directory, set its permissions to 1775 (owner and group rwx, others rx, sticky bit enabled) and set the directory owning group to the one created formerly. Then add all users that shall be able to write to that directory to this group.

datenwolf
  • 159,371
  • 13
  • 185
  • 298
0

Why don't you use a cronjob for that? You can set up this script (just the chmod line) to be run every minute...

Ubuntu CronHowto

centaurio
  • 63
  • 6