Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by $$anonymous$$ · Aug 08, 2013 at 05:34 PM · multiplayerserverlinuxunity 4.2headless

Linux Headless -- Application.Quit() doesn't work?

Hi,

I'm working on a real time multiplayer game where the servers are unity instances running on Linux (Ubuntu 12.04 LTS.) Unity 4.2's promise of a working headless mode for Linux had me quite excited, and early testing seems great (no xvfb dependency, massively reduced CPU utilization) but I'm having one issue:

Application.Quit() doesn't seem to work in Headless mode.

Is this working as intended? I use Application.Quit() in the server code to exit the process once a game is completed but this no longer works.

I've attached a sample project demonstrating the issue. It's really quite trivial but if you build in headless mode the process does not exit. If you build without headless mode the process exists as expected.

Headless Project

headless.zip (94.0 kB)
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Alishev · Nov 24, 2014 at 02:11 PM 0
Share

how do you run your project in server in headless mode?

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Schubkraft · Aug 15, 2013 at 09:45 AM

This is currently a bug in Unity. Sorry.

Try using System.Diagnostics.Process.GetCurrentProcess().Kill(); in the meantime.

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image $$anonymous$$ · Aug 15, 2013 at 03:33 PM 0
Share

Thanks for the answer!

I filed a bug report shortly after asking the question it was confirmed and can be viewed here: https://fogbugz.unity3d.com/default.asp?556483_89f4a1i8t6dh18oh (so others might know when it gets fixed.)

avatar image Arcanor · Aug 25, 2013 at 08:25 PM 0
Share

I confirm that this workaround works, although it's a bit of a sledgehammer effect, and causes your OnApplicationQuit() not to be called first. I hope that UT will be fixing this soon!

avatar image Benproductions1 · Sep 28, 2013 at 02:00 AM 0
Share

Wouldn't System.Environment.Exit() be a better solution?

avatar image mpartel Benproductions1 · Oct 14, 2018 at 12:10 PM 0
Share

System.Environment.Exit() is unreliable for me. It usually gets stuck after trying to tgkill() some thread, but weirdly, it does it only in Docker. GetCurrentProcess().$$anonymous$$ill() works for me.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Linux game server 1 Answer

Unity networking tutorial? 6 Answers

What does the headless build option do? 3 Answers

Networking with Linux 1 Answer

How to remove unneeded references (texture, audio) when doing headless server builds? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges