Skip to content

Instantly share code, notes, and snippets.

View zeroasterisk's full-sized avatar

alan blount zeroasterisk

View GitHub Profile
@zeroasterisk
zeroasterisk / _service.md
Created February 5, 2016 14:43 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
Meteor.subscribe(
'server_sessions',
amplify.store('session'), // Read from local storage / cookies
function() {
// The server returns only one record, so findOne will return that record
serverSession = new Meteor.Collection('server_sessions').findOne();
// Stores into client session all data contained in server session;
// supports reactivity when server changes the serverSession
Session.set('serverSession', serverSession);
// Stores the server session id into local storage / cookies