Commit 464e28ad0323bf2db7e1002e1f950610fc4a90d3
- Diff rendering mode:
- inline
- side by side
targets/dss11/recipes/dss/dss.inc
(55 / 50)
|   | |||
| 5 | 5 | LICENSE="GPLv3" | |
| 6 | 6 | DEPENDS = "boost poco gsoap libical js libxml2 avahi" | |
| 7 | 7 | RDEPENDS_${PN} += "svlogd2 runit" | |
| 8 | INC_PR="18" | ||
| 8 | INC_PR="19" | ||
| 9 | 9 | ARM_INSTRUCTION_SET = "arm" | |
| 10 | 10 | ||
| 11 | 11 | # INITSCRIPT_NAME = "dss.sh" | |
| … | … | ||
| 90 | 90 | done | |
| 91 | 91 | } | |
| 92 | 92 | ||
| 93 | pkg_postinst_${PN}() { | ||
| 94 | #!/bin/sh | ||
| 95 | |||
| 96 | FOUND=0 | ||
| 97 | for line in `mount -t aufs`; do | ||
| 98 | if [[ "`echo $line | cut -f 3`" == "/usr/share/dss" ]]; then | ||
| 99 | FOUND=1 | ||
| 100 | echo "Overlay on /usr/share/dss is already mounted, proceeding..." | ||
| 101 | break | ||
| 102 | fi | ||
| 103 | done | ||
| 104 | |||
| 105 | if [[ $FOUND -eq 0 ]]; then | ||
| 106 | echo -n "Mounting aufs overlay on /usr/share/dss..." | ||
| 107 | mount /usr/share/dss | ||
| 108 | if [[ $? -ne 0 ]]; then | ||
| 109 | echo | ||
| 110 | echo "Failed to mount aufs overlay on /usr/share/dss!" | ||
| 111 | echo "Manual interaction required, aborting package installation!" | ||
| 112 | exit 1 | ||
| 113 | fi | ||
| 114 | echo " done." | ||
| 115 | break | ||
| 116 | fi | ||
| 117 | |||
| 118 | if [[ -f "/etc/runit/dss/supervise/stat" ]]; then | ||
| 119 | if [[ "`cat /etc/runit/dss/supervise/stat`" == "down" ]]; then | ||
| 120 | echo "Starting dSS..." | ||
| 121 | sv -w 15 up /etc/runit/dss | ||
| 122 | if [[ $? -ne 0 ]]; then | ||
| 123 | echo "sv command return error, could not start dSS!" | ||
| 124 | fi | ||
| 125 | fi | ||
| 126 | fi | ||
| 127 | |||
| 128 | } | ||
| 129 | |||
| 93 | 130 | pkg_prerm_${PN}() { | |
| 94 | #/bin/sh | ||
| 131 | #!/bin/sh | ||
| 95 | 132 | ||
| 96 | if test -e "/etc/runit/dss/supervise/stat"; then | ||
| 97 | if test `cat /etc/runit/dss/supervise/stat` = "run"; then | ||
| 133 | if [[ -f "/etc/runit/dss/supervise/stat" ]]; then | ||
| 134 | if [[ "`cat /etc/runit/dss/supervise/stat`" == "run" ]]; then | ||
| 98 | 135 | echo "Stopping dSS..." | |
| 99 | 136 | sv -w 15 down /etc/runit/dss | |
| 100 | if [ "$?" -ne "0" ]; then | ||
| 137 | if [[ $? -ne 0 ]]; then | ||
| 101 | 138 | echo "sv command returned error, could not stop dSS!" | |
| 102 | 139 | exit 1 | |
| 103 | 140 | fi | |
| … | … | ||
| 142 | 142 | fi | |
| 143 | 143 | ||
| 144 | 144 | for line in `mount -t aufs`; do | |
| 145 | if test `echo $line | cut -f 3` = "/usr/share/dss"; then | ||
| 145 | if [[ "`echo $line | cut -f 3`" == "/usr/share/dss" ]]; then | ||
| 146 | 146 | echo -n "Unmounting aufs overlay on /usr/share/dss..." | |
| 147 | 147 | umount /usr/share/dss | |
| 148 | if [ "$?" -ne "0" ]; then | ||
| 148 | if [[ $? -ne 0 ]]; then | ||
| 149 | 149 | echo | |
| 150 | 150 | echo "Failed to unmount aufs overlay on /usr/share/dss!" | |
| 151 | 151 | echo "Manual interaction required, aborting package removal!" | |
| 152 | 152 | exit 1 | |
| 153 | 153 | fi | |
| 154 | 154 | echo " done." | |
| 155 | break | ||
| 155 | 156 | fi | |
| 156 | 157 | done | |
| 157 | 158 | ||
| 158 | 159 | } | |
| 159 | 160 | ||
| 160 | 161 | pkg_preinst_${PN}() { | |
| 161 | #/bin/sh | ||
| 162 | #!/bin/sh | ||
| 162 | 163 | ||
| 163 | if test -e "/etc/runit/dss/supervise/stat"; then | ||
| 164 | if test `cat /etc/runit/dss/supervise/stat` = "run"; then | ||
| 164 | if [[ -f "/etc/runit/dss/supervise/stat" ]]; then | ||
| 165 | if [[ "`cat /etc/runit/dss/supervise/stat`" == "run" ]]; then | ||
| 165 | 166 | echo "Stopping dSS..." | |
| 166 | 167 | sv -w 15 down /etc/runit/dss | |
| 167 | if [ "$?" -ne "0" ]; then | ||
| 168 | if [[ $? -ne 0 ]]; then | ||
| 168 | 169 | echo "sv command returned error, could not stop dSS!" | |
| 169 | 170 | exit 1 | |
| 170 | 171 | fi | |
| 171 | 172 | fi | |
| 172 | 173 | fi | |
| 173 | 174 | ||
| 175 | |||
| 174 | 176 | for line in `mount -t aufs`; do | |
| 175 | if test `echo $line | cut -f 3` = "/usr/share/dss"; then | ||
| 177 | if [[ "`echo $line | cut -f 3`" == "/usr/share/dss" ]]; then | ||
| 176 | 178 | echo -n "Unmounting aufs overlay on /usr/share/dss..." | |
| 177 | 179 | umount /usr/share/dss | |
| 178 | if [ "$?" -ne "0" ]; then | ||
| 180 | if [[ $? -ne 0 ]]; then | ||
| 179 | 181 | echo | |
| 180 | 182 | echo "Failed to unmount aufs overlay on /usr/share/dss!" | |
| 181 | 183 | echo "Manual interaction required, aborting package removal!" | |
| 182 | 184 | exit 1 | |
| 183 | 185 | fi | |
| 184 | 186 | echo " done." | |
| 185 | fi | ||
| 186 | done | ||
| 187 | |||
| 188 | } | ||
| 189 | |||
| 190 | pkg_postinst_${PN}() { | ||
| 191 | #/bin/sh | ||
| 192 | |||
| 193 | FOUND=0 | ||
| 194 | for line in `mount -t aufs`; do | ||
| 195 | if test `echo $line | cut -f 3` = "/usr/share/dss"; then | ||
| 196 | FOUND=1 | ||
| 197 | echo "Overlay on /usr/share/dss is already mounted, proceeding..." | ||
| 198 | 187 | break | |
| 199 | 188 | fi | |
| 200 | 189 | done | |
| 201 | 190 | ||
| 202 | if [ "$FOUND" -eq "0" ]; then | ||
| 203 | echo -n "Mounting aufs overlay on /usr/share/dss..." | ||
| 204 | mount /usr/share/dss | ||
| 205 | if [ "$?" -ne "0" ]; then | ||
| 206 | echo | ||
| 207 | echo "Failed to mount aufs overlay on /usr/share/dss!" | ||
| 208 | echo "Manual interaction required, aborting package installation!" | ||
| 209 | exit 1 | ||
| 210 | fi | ||
| 211 | echo " done." | ||
| 212 | fi | ||
| 213 | |||
| 214 | if test -e "/etc/runit/dss/supervise/stat"; then | ||
| 215 | if test `cat /etc/runit/dss/supervise/stat` = "down"; then | ||
| 216 | echo "Starting dSS..." | ||
| 217 | sv -w 15 up /etc/runit/dss | ||
| 218 | if [ "$?" -ne "0" ]; then | ||
| 219 | echo "sv command return error, could not start dSS!" | ||
| 220 | fi | ||
| 221 | fi | ||
| 222 | fi | ||
| 223 | |||
| 224 | 191 | } | |
| 225 | 192 | ||
| 226 | 193 | pkg_postrm_${PN}() { | |
| 227 | #/bin/sh | ||
| 194 | #!/bin/sh | ||
| 228 | 195 | ||
| 229 | if test -d "/etc/runit/dss"; then | ||
| 196 | if [[ -d "/etc/runit/dss" ]]; then | ||
| 230 | 197 | rm -rf /etc/runit/dss | |
| 231 | 198 | fi | |
| 199 | |||
| 232 | 200 | } | |
| 233 | 201 | ||
| 234 | 202 |
targets/dss11/recipes/dss/files/dss.run
(1 / 1)
|   | |||
| 6 | 6 | ||
| 7 | 7 | mkdir -p $LOGDIR | |
| 8 | 8 | mkdir -p $TRAFFICDIR | |
| 9 | chown a+rx $LOGDIR $TRAFFICDIR | ||
| 9 | chmod a+rx $LOGDIR $TRAFFICDIR | ||
| 10 | 10 | ||
| 11 | 11 | APP=/usr/bin/dss | |
| 12 | 12 | OPTIONS="--prop:/config/jslogdirectory=/var/log/dss \ |

