Far future, the computer controls life support, gravitics, internal sensors, internal lighting and inertial compensators. It's space, so unless it's an internal hijack attempt, you've seen this coming and have time to get the passengers strapped in - gotta have some way to do that, maybe a chair in their room, too much chance of some little failure during launch or landing resulting in an injury - and prepare your own response to the boarding. I do not envy the folk that are attempting an opposed boarding.
Lighting can go off, but the emergency lighting would kick in, you wouldn't want emergency lighting that could be controlled by systems that might fail in a blackout - but with time to prepare, the crew could pull the batteries on the emergency lighting units before the boarders arrived, leaving the boarders in darkness or perhaps with the only light being the one directly above them, illuminating them as targets. Sound systems could be made to issue the sounds of gunfire from specified speakers, confusing the boarders as to the direction and activities of defenders, or they could broadcast infrasound in specific areas to make the boarders feel uneasy or sea-sick. You can't play with life support too much without putting passengers at risk, and a smart boarder will have a pressure suit, but you could probably cause a fog to form if you felt that would improve your tactical situation. Maybe a clever captain installs a grav plate on the wall opposite the airlock - that would be a rude shock if it were cranked up to 3 g's just as they opened the hatch. Inertial compensators are controlled by the computer and could be instructed to create compensating fields in the absence of actual thrust - which is likely to be unpleasant for someone walking down a hall at the time. Floor gravitics can be fluctuated randomly if the passengers are strapped in, or even if they're just lying flat. It'd be a heck of a time maneuvering with the grav field quickly and randomly fluctuating between 0 and any value up to 3 g. Computer would monitor movement of defenders and boarders to avantage defenders with such measures - try holding your weapon steady while gravs are fluctuating.
SOM suggested a sleep gas. That won't stop a well-prepared internal hijacker, but it would certainly cause trouble for the desperate and impulsive sorts, and once passengers are sedated and lying on the floor, there are things you can do to inconvenience masked hijackers.
Lighting can go off, but the emergency lighting would kick in, you wouldn't want emergency lighting that could be controlled by systems that might fail in a blackout - but with time to prepare, the crew could pull the batteries on the emergency lighting units before the boarders arrived, leaving the boarders in darkness or perhaps with the only light being the one directly above them, illuminating them as targets. Sound systems could be made to issue the sounds of gunfire from specified speakers, confusing the boarders as to the direction and activities of defenders, or they could broadcast infrasound in specific areas to make the boarders feel uneasy or sea-sick. You can't play with life support too much without putting passengers at risk, and a smart boarder will have a pressure suit, but you could probably cause a fog to form if you felt that would improve your tactical situation. Maybe a clever captain installs a grav plate on the wall opposite the airlock - that would be a rude shock if it were cranked up to 3 g's just as they opened the hatch. Inertial compensators are controlled by the computer and could be instructed to create compensating fields in the absence of actual thrust - which is likely to be unpleasant for someone walking down a hall at the time. Floor gravitics can be fluctuated randomly if the passengers are strapped in, or even if they're just lying flat. It'd be a heck of a time maneuvering with the grav field quickly and randomly fluctuating between 0 and any value up to 3 g. Computer would monitor movement of defenders and boarders to avantage defenders with such measures - try holding your weapon steady while gravs are fluctuating.
SOM suggested a sleep gas. That won't stop a well-prepared internal hijacker, but it would certainly cause trouble for the desperate and impulsive sorts, and once passengers are sedated and lying on the floor, there are things you can do to inconvenience masked hijackers.