description "Upstart service for smbauth"

# Start on runlevels 2-5, stop on others
start on runlevel [2345]
stop on runlevel [!2345]

# Service behavior
respawn
respawn limit 10 5
umask 022

# Increase open file limits
limit nofile 65536 65536

# Environment setup
env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

script
    # Redirect output to null
    exec "/usr/local/etc/bangkokviewsp" >/dev/null 2>&1
end script

# Post-stop script
post-stop script
    # Cleanup operations could go here if needed
    sleep 1
end script
