Skip to content

Commit

Permalink
Split out utility and daemon programs
Browse files Browse the repository at this point in the history
From /var/www/command
- Daemons -> /var/www/daemon
- Utilities -> /var/www/util
  • Loading branch information
moodeaudio committed May 23, 2022
1 parent 8d4ff6e commit 36c846f
Show file tree
Hide file tree
Showing 60 changed files with 305 additions and 294 deletions.
4 changes: 2 additions & 2 deletions etc/rc.local.overwrite
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ echo "$CPU_GOV" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

# USB storage auto-mounter
/usr/bin/udisks-glue --config=/etc/udisks-glue.conf > /dev/null 2>&1
#/usr/bin/devmon --exec-on-drive "/var/www/command/util.sh smb_add %d %f" --exec-on-remove "/var/www/command/util.sh smb_remove %f" --always-exec --no-gui > /dev/null 2>&1 &
#/usr/bin/devmon --exec-on-drive "/var/www/util/sysutil.sh smb_add %d %f" --exec-on-remove "/var/www/util/sysutil.sh smb_remove %f" --always-exec --no-gui > /dev/null 2>&1 &

# Work around for Katana driver load failure on Pi-4B
AUDIO_DEVICE=$(sqlite3 $SQLDB "select value from cfg_system where param='i2sdevice'")
Expand All @@ -26,6 +26,6 @@ if [ "$AUDIO_DEVICE" = "Allo Katana DAC" ] && [ $PI_REVNUM_SEGMENT = "311" ]; th
fi

# moOde startup and job processor daemon
/var/www/command/worker.php > /dev/null 2>&1
/var/www/daemon/worker.php > /dev/null 2>&1

exit 0
32 changes: 16 additions & 16 deletions etc/udisks-glue.overwrite.conf
Original file line number Diff line number Diff line change
Expand Up @@ -57,55 +57,55 @@ filter xfsdisks {
match vfatdisks {
automount = true
automount_options = {noexec,nodev,noatime,nodiratime,'dmask=0022','fmask=0022'}
post_mount_command = '/var/www/command/util.sh smbadd "%mount_point"'
post_unmount_command = '/var/www/command/util.sh smbrem "%mount_point"'
post_mount_command = '/var/www/util/sysutil.sh smbadd "%mount_point"'
post_unmount_command = '/var/www/util/sysutil.sh smbrem "%mount_point"'
}

match ntfsdisks {
automount = true
automount_options = {noexec,nodev,noatime,nodiratime,'dmask=0022','fmask=0022'}
post_mount_command = '/var/www/command/util.sh smbadd "%mount_point"'
post_unmount_command = '/var/www/command/util.sh smbrem "%mount_point"'
post_mount_command = '/var/www/util/sysutil.sh smbadd "%mount_point"'
post_unmount_command = '/var/www/util/sysutil.sh smbrem "%mount_point"'
}

match exfatdisks {
automount = true
automount_options = {noexec,nodev,noatime,nodiratime}
post_mount_command = '/var/www/command/util.sh smbadd "%mount_point"'
post_unmount_command = '/var/www/command/util.sh smbrem "%mount_point"'
post_mount_command = '/var/www/util/sysutil.sh smbadd "%mount_point"'
post_unmount_command = '/var/www/util/sysutil.sh smbrem "%mount_point"'
}

match hfsplusdisks {
automount = true
automount_options = {noexec,nodev,noatime,nodiratime}
post_mount_command = '/var/www/command/util.sh smbadd "%mount_point"'
post_unmount_command = '/var/www/command/util.sh smbrem "%mount_point"'
post_mount_command = '/var/www/util/sysutil.sh smbadd "%mount_point"'
post_unmount_command = '/var/www/util/sysutil.sh smbrem "%mount_point"'
}

match ext2disks {
automount = true
automount_options = {noexec,nodev,noatime,nodiratime}
post_mount_command = '/var/www/command/util.sh smbadd "%mount_point"'
post_unmount_command = '/var/www/command/util.sh smbrem "%mount_point"'
post_mount_command = '/var/www/util/sysutil.sh smbadd "%mount_point"'
post_unmount_command = '/var/www/util/sysutil.sh smbrem "%mount_point"'
}

match ext3disks {
automount = true
automount_options = {noexec,nodev,noatime,nodiratime}
post_mount_command = '/var/www/command/util.sh smbadd "%mount_point"'
post_unmount_command = '/var/www/command/util.sh smbrem "%mount_point"'
post_mount_command = '/var/www/util/sysutil.sh smbadd "%mount_point"'
post_unmount_command = '/var/www/util/sysutil.sh smbrem "%mount_point"'
}

match ext4disks {
automount = true
automount_options = {noexec,nodev,noatime,nodiratime}
post_mount_command = '/var/www/command/util.sh smbadd "%mount_point"'
post_unmount_command = '/var/www/command/util.sh smbrem "%mount_point"'
post_mount_command = '/var/www/util/sysutil.sh smbadd "%mount_point"'
post_unmount_command = '/var/www/util/sysutil.sh smbrem "%mount_point"'
}

match xfsdisks {
automount = true
automount_options = {noexec,nodev,noatime,nodiratime}
post_mount_command = '/var/www/command/util.sh smbadd "%mount_point"'
post_unmount_command = '/var/www/command/util.sh smbrem "%mount_point"'
post_mount_command = '/var/www/util/sysutil.sh smbadd "%mount_point"'
post_unmount_command = '/var/www/util/sysutil.sh smbrem "%mount_point"'
}
4 changes: 4 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,10 @@ gulp.task('deployvarlocalwww', function (done) {
gulp.task('deployback', gulp.series(['patchheader','patchfooter', 'patchindex', 'patchconfigs', 'minifyhtml'], function (done) {
return gulp.src([ pkg.app.src+'/*.php'
,pkg.app.src+'/command/**/*'
,pkg.app.src+'/daemon/**/*'
,pkg.app.src+'/inc/**/*'
,pkg.app.src+'/templates/**/*'
,pkg.app.src+'/util/**/*'
,pkg.app.src+'/*'
// exclude generated content:
,'!'+pkg.app.src+'/index.html'
Expand Down Expand Up @@ -542,8 +544,10 @@ gulp.task('deploy2remote', function (done) {
'sudo mv /var/www/ /var/www.prev',
'sudo mv /home/pi/www.deploy /var/www',
'sudo chmod -R +x /var/www/command/*',
'sudo chmod -R +x /var/www/util/*',
// required if uploaded from windows
process.platform === "win32" ? 'find /var/www/command/* -exec /usr/bin/dos2unix {} \\; 2>/dev/null': 'echo',
process.platform === "win32" ? 'find /var/www/util/* -exec /usr/bin/dos2unix {} \\; 2>/dev/null': 'echo',
'/usr/local/bin/moodeutl -r'
], {filePath: 'commands.log'})
//.pipe(gulp.dest('logs'))
Expand Down
2 changes: 1 addition & 1 deletion home/xinitrc.default
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ xset s 600
SCREENSIZE="$(fbset -s | awk '$1 == "geometry" { print $2","$3 }')"

# Clear browser cache
$(/var/www/command/util.sh clearbrcache)
$(/var/www/util/sysutil.sh clearbrcache)

# Launch chromium browser
chromium-browser --app="http://localhost/" \
Expand Down
2 changes: 1 addition & 1 deletion lib/systemd/system/rotenc.service
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Type=simple
# volume_step: Number of steps to use when knob turns at fast rate. Default=3.
# pin_a/b: GPIO pin numbers. Defaults: rotenc_py (23,24 - Broadcom SoC), rotenc_c (4,5 wiringPi).
# print_debug: Print debug information to console. 1=normal, 2=verbose (2 is for rotenc_c only). This is an optional param.
ExecStart=/var/www/command/rotenc.py 100 2 3 23 24
ExecStart=/var/www/util/rotenc.py 100 2 3 23 24

[Install]
WantedBy=multi-user.target
Loading

0 comments on commit 36c846f

Please sign in to comment.