Files
scst/usr/stpgd
Bart Van Assche e1b418938e usr/stpgd: Fix make install failure for relative DESTDIR
When DESTDIR is a relative path, make install fails to install
`scst_on_stpg` for not having created `$(DESTDIR)$(PREFIX)/bin/scst`.

When DESTDIR is an absolute path, make install doesn't fail to install
`scst_on_stpg` because usr/fileio has already created the directory.

usr/stpgd should explicitly create `$(DESTDIR)$(PREFIX)/bin/scst`
so that it can handle a relative DESTDIR, plus be independent of
usr/fileio installation.

--
 # cd usr
 # make install DESTDIR=./aaa
 cd fileio && make install
 make[1]: Entering directory '/tmp/scst/usr/fileio'
 install -d ./aaa/usr/local/bin/scst
 install -m 755 fileio_tgt ./aaa/usr/local/bin/scst
 make[1]: Leaving directory '/tmp/scst/usr/fileio'
 cd stpgd && make install
 make[1]: Entering directory '/tmp/scst/usr/stpgd'
 install -d ./aaa/usr/local/sbin
 install -m 700 stpgd ./aaa/usr/local/sbin
 install -m 700 scst_on_stpg ./aaa/usr/local/bin/scst/scst_on_stpg
 install: cannot create regular file './aaa/usr/local/bin/scst/scst_on_stpg': No such file or directory
 Makefile:60: recipe for target 'install' failed
 make[1]: *** [install] Error 1
 make[1]: Leaving directory '/tmp/scst/usr/stpgd'
 Makefile:32: recipe for target 'install' failed
 make: *** [install] Error 2

Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@osnexus.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7403 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-06-04 16:23:45 +00:00
..
2015-11-06 03:40:37 +00:00
2015-11-06 03:40:37 +00:00
2015-11-06 03:40:37 +00:00

This is stpgd service called by the SCST core upon receiving SET TARGET
PORT GROUPS command via SCST events subsystem. In turn, stpgd calls
external script to actually modify ALUA state as requested by the SET
TARGET PORT GROUPS command via cluster manager and SCST sysfs. You can
find example of such script in scst_on_stpg file.

Reason why such dual stage approach is used is, because there is no way
from inside the kernel to control execution of external programs and
there is no way to write a service calling IOCTLs on shell.